From: Tom Lane Date: Tue, 2 Mar 2004 21:15:15 +0000 (+0000) Subject: Always schema-qualify the name of a function referenced in CREATE CAST. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=bf942fed03e64804b11a051a2dd1ddecc15cbdab;p=users%2Fbernd%2Fpostgres.git 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 15033f9869..d61a0d56df 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -3917,8 +3917,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");