pg_dump getBlobs query broken for 7.3 servers

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_dump getBlobs query broken for 7.3 servers
Date: 2016-10-07 02:47:51
Message-ID: 0a3e7a0e-37bd-8427-29bd-958135862f0a@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Just noticed that the getBlobs() query does not work for a 7.3 server
(maybe <= 7.3) due to the following change in commit 23f34fa4 [1]:

else if (fout->remoteVersion >= 70100)
appendPQExpBufferStr(blobQry,
- "SELECT DISTINCT loid, NULL::oid, NULL::oid"
+ "SELECT DISTINCT loid, NULL::oid, NULL, "
+ "NULL AS rlomacl, NULL AS initlomacl, "
+ "NULL AS initrlomacl "
" FROM pg_largeobject");
else
appendPQExpBufferStr(blobQry,
- "SELECT oid, NULL::oid, NULL::oid"
+ "SELECT oid, NULL::oid, NULL, "
+ "NULL AS rlomacl, NULL AS initlomacl, "
+ "NULL AS initrlomacl "
" FROM pg_class WHERE relkind = 'l'");

The following error is reported by the server:

pg_dump: [archiver (db)] query failed: ERROR: Unable to identify an
ordering operator '<' for type '"unknown"'
Use an explicit ordering operator or modify the query
pg_dump: [archiver (db)] query was: SELECT DISTINCT loid, NULL::oid, NULL,
NULL AS rlomacl, NULL AS initlomacl, NULL AS initrlomacl FROM pg_largeobject

I could fix that using the attached patch.

Thanks,
Amit

[1]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=23f34fa4ba358671adab16773e79c17c92cbc870

Attachment Content-Type Size
pg-dump-getBlobs-fix.patch text/x-diff 1.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alfred Perlstein 2016-10-07 03:52:22 Re: pgbench vs. wait events
Previous Message Etsuro Fujita 2016-10-07 01:50:38 Re: postgres_fdw : altering foreign table not invalidating prepare statement execution plan.