mirror of
https://github.com/postgres/postgres.git
synced 2025-06-03 00:02:26 -04:00
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
This commit is contained in:
parent
00b24e1678
commit
bfd17f94b6
@ -12,7 +12,7 @@
|
|||||||
* by PostgreSQL
|
* by PostgreSQL
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.531 2009/03/26 22:26:07 petere Exp $
|
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.532 2009/04/01 18:54:27 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1995,7 +1995,13 @@ dumpBlobComments(Archive *AH, void *arg)
|
|||||||
selectSourceSchema("pg_catalog");
|
selectSourceSchema("pg_catalog");
|
||||||
|
|
||||||
/* Cursor to get all BLOB comments */
|
/* Cursor to get all BLOB comments */
|
||||||
if (AH->remoteVersion >= 70200)
|
if (AH->remoteVersion >= 70300)
|
||||||
|
blobQry = "DECLARE blobcmt CURSOR FOR SELECT loid, "
|
||||||
|
"obj_description(loid, 'pg_largeobject') "
|
||||||
|
"FROM (SELECT DISTINCT loid FROM "
|
||||||
|
"pg_description d JOIN pg_largeobject l ON (objoid = loid) "
|
||||||
|
"WHERE classoid = 'pg_largeobject'::regclass) ss";
|
||||||
|
else if (AH->remoteVersion >= 70200)
|
||||||
blobQry = "DECLARE blobcmt CURSOR FOR SELECT loid, "
|
blobQry = "DECLARE blobcmt CURSOR FOR SELECT loid, "
|
||||||
"obj_description(loid, 'pg_largeobject') "
|
"obj_description(loid, 'pg_largeobject') "
|
||||||
"FROM (SELECT DISTINCT loid FROM pg_largeobject) ss";
|
"FROM (SELECT DISTINCT loid FROM pg_largeobject) ss";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user