Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3e00d33

Browse files
committed
Have pg_dump in binary-upgrade mode properly drop user-created
extensions that might exist in the new empty cluster databases, likeplpgsql.Backpatch to 9.2.
1 parent0fc32c0 commit3e00d33

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7331,6 +7331,16 @@ dumpExtension(Archive *fout, ExtensionInfo *extinfo)
73317331
intn;
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);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp