Subject line kind of says it all: LANGUAGE replacement was introduced in 9.0, but pg_dump is trying it on all versions.
-- Greg Sabino Mullane [email protected] End Point Corporation PGP Key: 0x14964AC8 201005121537 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 2431d71..c8f231c 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -7601,9 +7601,14 @@ dumpProcLang(Archive *fout, ProcLangInfo *plang)
* is a pg_pltemplate entry, and if there is one, the existing
entry
* must match it too.
*/
- appendPQExpBuffer(defqry, "CREATE OR REPLACE PROCEDURAL
LANGUAGE %s",
- qlanname);
+ if (g_fout->remoteVersion < 90000)
+ appendPQExpBuffer(defqry, "CREATE PROCEDURAL LANGUAGE
%s",
+ qlanname);
+ else
+ appendPQExpBuffer(defqry, "CREATE OR REPLACE PROCEDURAL
LANGUAGE %s",
+ qlanname);
}
+
appendPQExpBuffer(defqry, ";\n");
ArchiveEntry(fout, plang->dobj.catId, plang->dobj.dumpId,
pgpvIlb6dEdnL.pgp
Description: PGP signature
