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

Commit471a7af

Browse files
committed
Ensure consistent sort order of large objects in pg_dump.
The primary purpose of this commit is to ensure pg_upgrade tests yieldcomparable dumps pre/post upgrade, which got broken by12a53c7 /578b229, as the order in pg_largeobject_metadata is likely todiffer pre/post upgrade.It also seems like a generally good idea to make sure such dumps arecomparable, outside of pg_upgrade tests.LO metadata already was already dumped in an ordered manner as themetadata is dumped in a well defined order viasortDumpableObjectsByTypeName() and sortDumpableObjects(). But largeobject data is currently not tracked via that mechanism.As Tom points out it seems possible that at some point dumpBlobs() wasassumed to dump out objects in a well defined order, due to the use ofDISTINCT, which at that time only was done using sorting.Per complaint from Andrew Dunstan and discussion with him and TomLane.Author: Andres FreundDiscussion:https://postgr.es/m/2735.1543333649@sss.pgh.pa.us
1 parentb238527 commit471a7af

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,9 +3328,13 @@ dumpBlobs(Archive *fout, void *arg)
33283328
* the already-in-memory dumpable objects instead...
33293329
*/
33303330
if (fout->remoteVersion >= 90000)
3331-
blobQry = "DECLARE bloboid CURSOR FOR SELECT oid FROM pg_largeobject_metadata";
3331+
blobQry =
3332+
"DECLARE bloboid CURSOR FOR "
3333+
"SELECT oid FROM pg_largeobject_metadata ORDER BY 1";
33323334
else
3333-
blobQry = "DECLARE bloboid CURSOR FOR SELECT DISTINCT loid FROM pg_largeobject";
3335+
blobQry =
3336+
"DECLARE bloboid CURSOR FOR "
3337+
"SELECT DISTINCT loid FROM pg_largeobject ORDER BY 1";
33343338

33353339
ExecuteSqlStatement(fout, blobQry);
33363340

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp