aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-10-28 21:05:39 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-10-28 21:05:39 +0000
commit0847c879a91792ff51da08a6fd15a565935f8741 (patch)
treef978bfe003d61a1abfe34741f4211d94b7437d0f /src
parent98c7f157f2688ab83e97fa03b9e1bf194eadb2ba (diff)
downloadpostgresql-0847c879a91792ff51da08a6fd15a565935f8741.tar.gz
postgresql-0847c879a91792ff51da08a6fd15a565935f8741.zip
Don't choke when the handler for a procedural language is located in
the pg_catalog schema. Per bug report some months back from Jochem van Dieten.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_dump.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index f3bd4bee791..a6a4d1e0a97 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.8 2003/09/28 17:46:19 wieck Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.305.2.9 2003/10/28 21:05:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3462,25 +3462,6 @@ dumpProcLangs(Archive *fout, FuncInfo finfo[], int numFuncs)
lanacl = "{=U}";
}
- fidx = findFuncByOid(finfo, numFuncs, lanplcallfoid);
- if (fidx < 0)
- {
- write_msg(NULL, "handler procedure for procedural language %s not found\n",
- lanname);
- exit_nicely();
- }
-
- if (strcmp(lanvalidator, "0") != 0)
- {
- vidx = findFuncByOid(finfo, numFuncs, lanvalidator);
- if (vidx < 0)
- {
- write_msg(NULL, "validator procedure for procedural language %s not found\n",
- lanname);
- exit_nicely();
- }
- }
-
/*
* Current theory is to dump PLs iff their underlying functions
* will be dumped (are in a dumpable namespace, or have a
@@ -3488,10 +3469,27 @@ dumpProcLangs(Archive *fout, FuncInfo finfo[], int numFuncs)
* PL itself as being in the underlying function's namespace,
* though it isn't really. This avoids searchpath problems for
* the HANDLER clause.
+ *
+ * If the underlying function is in the pg_catalog namespace,
+ * we won't have loaded it into finfo[] at all; therefore,
+ * treat failure to find it in finfo[] as indicating we shouldn't
+ * dump it, not as an error condition. Ditto for the validator.
*/
+
+ fidx = findFuncByOid(finfo, numFuncs, lanplcallfoid);
+ if (fidx < 0)
+ continue;
+
if (!finfo[fidx].pronamespace->dump)
continue;
+ if (strcmp(lanvalidator, "0") != 0)
+ {
+ vidx = findFuncByOid(finfo, numFuncs, lanvalidator);
+ if (vidx < 0)
+ continue;
+ }
+
resetPQExpBuffer(defqry);
resetPQExpBuffer(delqry);