summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2004-03-02 21:14:59 +0000
committerTom Lane2004-03-02 21:14:59 +0000
commitf0d32c033a3eb16fabfb4a4424fcccfff115509a (patch)
treecedb791919b8b13cf479fd8a4be445237567e34c
parent819bfac66ae3b0f567f278c734bb47e54d6e9bb4 (diff)
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?
-rw-r--r--src/bin/pg_dump/pg_dump.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 80d566d1454..1ebe39a25b4 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");