Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bfd17f9

Browse files
committed
Improve pg_dump's query for retrieving BLOB comments to be more efficient
when there are many blobs and not so many comments. Tamas Vincze
1 parent 00b24e1 commit bfd17f9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/bin/pg_dump/pg_dump.c

+8-2
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.531 2009/03/26 22:26:07 petere Exp $
15+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.532 2009/04/01 18:54:27 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -1995,7 +1995,13 @@ dumpBlobComments(Archive *AH, void *arg)
19951995
selectSourceSchema("pg_catalog");
19961996

19971997
/* Cursor to get all BLOB comments */
1998-
if (AH->remoteVersion >= 70200)
1998+
if (AH->remoteVersion >= 70300)
1999+
blobQry = "DECLARE blobcmt CURSOR FOR SELECT loid, "
2000+
"obj_description(loid, 'pg_largeobject') "
2001+
"FROM (SELECT DISTINCT loid FROM "
2002+
"pg_description d JOIN pg_largeobject l ON (objoid = loid) "
2003+
"WHERE classoid = 'pg_largeobject'::regclass) ss";
2004+
else if (AH->remoteVersion >= 70200)
19992005
blobQry = "DECLARE blobcmt CURSOR FOR SELECT loid, "
20002006
"obj_description(loid, 'pg_largeobject') "
20012007
"FROM (SELECT DISTINCT loid FROM pg_largeobject) ss";

0 commit comments

Comments
 (0)