From: Tom Lane Date: Tue, 2 Mar 2004 21:14:59 +0000 (+0000) Subject: Always schema-qualify the name of a function referenced in CREATE CAST. X-Git-Tag: REL7_4_2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0d32c033a3eb16fabfb4a4424fcccfff115509a;p=postgresql Always schema-qualify the name of a function referenced in CREATE CAST. The former coding failed if the cast function was not in the pg_catalog schema. How'd this escape detection? --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 80d566d145..1ebe39a25b 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -12,7 +12,7 @@ * by PostgreSQL * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.355.2.3 2004/02/24 03:35:45 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.355.2.4 2004/03/02 21:14:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -4083,8 +4083,16 @@ dumpCasts(Archive *fout, if (strcmp(castfunc, "0") == 0) appendPQExpBuffer(defqry, "WITHOUT FUNCTION"); else - appendPQExpBuffer(defqry, "WITH FUNCTION %s", - format_function_signature(&finfo[fidx], true)); + { + /* + * Always qualify the function name, in case it is not in + * pg_catalog schema (format_function_signature won't qualify it). + */ + appendPQExpBuffer(defqry, "WITH FUNCTION %s.", + fmtId(finfo[fidx].pronamespace->nspname)); + appendPQExpBuffer(defqry, "%s", + format_function_signature(&finfo[fidx], true)); + } if (strcmp(castcontext, "a") == 0) appendPQExpBuffer(defqry, " AS ASSIGNMENT");