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

Commitb773987

Browse files
committed
Repair remarkably-inefficient query for dumping large object comments: it
was invoking obj_description() for each large object chunk, instead of onceper large object. This code is new as of 8.1, which may explain why theproblem hadn't been noticed already.
1 parent5de0cbd commitb773987

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/bin/pg_dump/pg_dump.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.437 2006/06/07 22:24:45 momjian Exp $
15+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.438 2006/06/09 19:46:09 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -1575,9 +1575,9 @@ dumpBlobComments(Archive *AH, void *arg)
15751575

15761576
/* Cursor to get all BLOB comments */
15771577
if (AH->remoteVersion >=70200)
1578-
blobQry="DECLARE blobcmt CURSOR FOR SELECTDISTINCTloid, obj_description(loid, 'pg_largeobject') FROM pg_largeobject";
1578+
blobQry="DECLARE blobcmt CURSOR FOR SELECT loid, obj_description(loid, 'pg_largeobject') FROM(SELECT DISTINCT loid FROMpg_largeobject) ss";
15791579
elseif (AH->remoteVersion >=70100)
1580-
blobQry="DECLARE blobcmt CURSOR FOR SELECTDISTINCTloid, obj_description(loid) FROM pg_largeobject";
1580+
blobQry="DECLARE blobcmt CURSOR FOR SELECT loid, obj_description(loid) FROM(SELECT DISTINCT loid FROMpg_largeobject) ss";
15811581
else
15821582
blobQry="DECLARE blobcmt CURSOR FOR SELECT oid, (SELECT description FROM pg_description pd WHERE pd.objoid=pc.oid) FROM pg_class pc WHERE relkind = 'l'";
15831583

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp