* Since we don't provide any way to be selective about dumping blobs,
* there's no need to be selective about their comments either. We put
* all the comments into one big TOC entry.
*/
staticint
dumpBlobComments(Archive*AH,void*arg)
{
constchar*blobQry;
constchar*blobFetchQry;
PQExpBuffercommentcmd=createPQExpBuffer();
PGresult*res;
inti;
if(g_verbose)
write_msg(NULL,"saving large object comments\n");
/* Make sure we are in proper schema */
selectSourceSchema("pg_catalog");
/* Cursor to get all BLOB comments */
if(AH->remoteVersion>=70200)
blobQry="DECLARE blobcmt CURSOR FOR SELECT DISTINCT loid, obj_description(loid, 'pg_largeobject') FROM pg_largeobject";
elseif(AH->remoteVersion>=70100)
blobQry="DECLARE blobcmt CURSOR FOR SELECT DISTINCT loid, obj_description(loid) FROM pg_largeobject";
else
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'";