pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: pg_dump getBlobs query broken for 7.3 servers
Date: Fri, 7 Oct 2016 11:47:51 +0900
Message-ID: <0a3e7a0e-37bd-8427-29bd-958135862f0a@lab.ntt.co.jp> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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=23f34fa4ba358671adab16773e79c17c92cbc...

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

pg-dump-getBlobs-fix.patch (text/x-diff, 1.0K) download diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 299e887..a1165fa 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -2881,15 +2881,15 @@ getBlobs(Archive *fout) username_subquery); else if (fout->remoteVersion >= 70100) appendPQExpBufferStr(blobQry, - "SELECT DISTINCT loid, NULL::oid, NULL, " - "NULL AS rlomacl, NULL AS initlomacl, " - "NULL AS initrlomacl " + "SELECT DISTINCT loid, NULL::oid, NULL::oid, " + "NULL::oid AS rlomacl, NULL::oid AS initlomacl, " + "NULL::oid AS initrlomacl " " FROM pg_largeobject"); else appendPQExpBufferStr(blobQry, - "SELECT oid, NULL::oid, NULL, " - "NULL AS rlomacl, NULL AS initlomacl, " - "NULL AS initrlomacl " + "SELECT oid, NULL::oid, NULL::oid, " + "NULL::oid AS rlomacl, NULL::oid AS initlomacl, " + "NULL::oid AS initrlomacl " " FROM pg_class WHERE relkind = 'l'"); res = ExecuteSqlQuery(fout, blobQry->data, PGRES_TUPLES_OK);

view thread (22+ messages)  latest in thread

Message-ID: <0a3e7a0e-37bd-8427-29bd-958135862f0a@lab.ntt.co.jp>
Permalink:  ../0a3e7a0e-37bd-8427-29bd-958135862f0a@lab.ntt.co.jp/
Also on:    postgresql.org/message-id/0a3e7a0e-37bd-8427-29bd-958135862f0a@lab.ntt.co.jp

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: Langote_Amit_f8@lab.ntt.co.jp
  Subject: Re: pg_dump getBlobs query broken for 7.3 servers
  In-Reply-To: <0a3e7a0e-37bd-8427-29bd-958135862f0a@lab.ntt.co.jp>
  References: <0a3e7a0e-37bd-8427-29bd-958135862f0a@lab.ntt.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox