We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent0fc32c0 commit3e00d33Copy full SHA for 3e00d33
src/bin/pg_dump/pg_dump.c
@@ -7331,6 +7331,16 @@ dumpExtension(Archive *fout, ExtensionInfo *extinfo)
7331
intn;
7332
7333
appendPQExpBuffer(q,"-- For binary upgrade, create an empty extension and insert objects into it\n");
7334
+
7335
+/*
7336
+ *We unconditionally create the extension, so we must drop it if it
7337
+ *exists. This could happen if the user deleted 'plpgsql' and then
7338
+ *readded it, causing its oid to be greater than FirstNormalObjectId.
7339
+ *The FirstNormalObjectId test was kept to avoid repeatedly dropping
7340
+ *and recreating extensions like 'plpgsql'.
7341
+ */
7342
+appendPQExpBuffer(q,"DROP EXTENSION IF EXISTS %s;\n",qextname);
7343
7344
appendPQExpBuffer(q,
7345
"SELECT binary_upgrade.create_empty_extension(");
7346
appendStringLiteralAH(q,extinfo->dobj.name,fout);