File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -7331,6 +7331,16 @@ dumpExtension(Archive *fout, ExtensionInfo *extinfo)
73317331 int n ;
73327332
73337333 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+
73347344 appendPQExpBuffer (q ,
73357345 "SELECT binary_upgrade.create_empty_extension(" );
73367346 appendStringLiteralAH (q , extinfo -> dobj .name , fout );
You can’t perform that action at this time.
0 commit comments