aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-03-02 21:15:15 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-03-02 21:15:15 +0000
commite921472fefcb10cd462b318a59d7a5999417c8e8 (patch)
tree3e946c64d1a48ffad98ebeda9d703b9b48f638b2
parent2d558b2baa459628d73b48f7a2946a643815fb0e (diff)
downloadpostgresql-e921472fefcb10cd462b318a59d7a5999417c8e8.tar.gz
postgresql-e921472fefcb10cd462b318a59d7a5999417c8e8.zip
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 a6a4d1e0a97..626b81af9a7 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.305.2.9 2003/10/28 21:05:39 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.305.2.10 2004/03/02 21:15:15 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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");