aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-03-02 21:14:44 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-03-02 21:14:44 +0000
commit0c6e97db47185842c4dc547a52d24c3ddc5a229c (patch)
treeea06d437fbfe3aae036990e2e90aecd4c3e63068 /src
parent351cf4d04e16976d3d07d4042e1b89dd4e3c1247 (diff)
downloadpostgresql-0c6e97db47185842c4dc547a52d24c3ddc5a229c.tar.gz
postgresql-0c6e97db47185842c4dc547a52d24c3ddc5a229c.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?
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_dump.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 15e1b2bd010..47433c1d029 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.365 2004/02/24 03:35:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.366 2004/03/02 21:14:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -5080,8 +5080,16 @@ dumpCast(Archive *fout, CastInfo *cast)
if (!OidIsValid(cast->castfunc))
appendPQExpBuffer(defqry, "WITHOUT FUNCTION");
else
- appendPQExpBuffer(defqry, "WITH FUNCTION %s",
+ {
+ /*
+ * 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(funcInfo->pronamespace->nspname));
+ appendPQExpBuffer(defqry, "%s",
format_function_signature(funcInfo, NULL, true));
+ }
if (cast->castcontext == 'a')
appendPQExpBuffer(defqry, " AS ASSIGNMENT");