-HEAD pg_dumpall broken against older backends - Mailing list pgsql-patches

From Stefan Kaltenbrunner
Subject -HEAD pg_dumpall broken against older backends
Date
Msg-id 442A8FE0.6000002@kaltenbrunner.cc
Whole thread Raw
Responses Re: -HEAD pg_dumpall broken against older backends
Re: -HEAD pg_dumpall broken against older backends
List pgsql-patches
Hi!

looks like somebody forgot to test some changes to the pg_dumpall code
in Revision 1.70 against <8.1 installations -  resulting in the
following syntax error:

--
-- PostgreSQL database cluster dump
--

\connect postgres

pg_dumpall: query failed: ERROR:  syntax error at or near "null"
LINE 1: ... passwd as rolpassword, valuntil as rolvaliduntil null as ro...
                                                              ^
pg_dumpall: query was: SELECT usename as rolname, usesuper as rolsuper,
true as rolinherit, usesuper as rolcreaterole, usecreatedb as
rolcreatedb, usecatupd as rolcatupdate, true as rolcanlogin, -1 as
rolconnlimit, passwd as rolpassword, valuntil as rolvaliduntil null as
rolcomment FROM pg_shadow UNION ALL SELECT groname as rolname, false as
rolsuper, true as rolinherit, false as rolcreaterole, false as
rolcreatedb, false as rolcatupdate, false as rolcanlogin, -1 as
rolconnlimit, null::text as rolpassword, null::abstime as rolvaliduntil
null FROM pg_group


proposed patch to fix problem is attached.


Stefan
Index: src/bin/pg_dump/pg_dumpall.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v
retrieving revision 1.72
diff -u -r1.72 pg_dumpall.c
--- src/bin/pg_dump/pg_dumpall.c    5 Mar 2006 15:58:51 -0000    1.72
+++ src/bin/pg_dump/pg_dumpall.c    29 Mar 2006 13:29:01 -0000
@@ -444,7 +444,7 @@
                           "true as rolcanlogin, "
                           "-1 as rolconnlimit, "
                           "passwd as rolpassword, "
-                          "valuntil as rolvaliduntil "
+                          "valuntil as rolvaliduntil, "
                           "null as rolcomment "
                           "FROM pg_shadow "
                           "UNION ALL "
@@ -457,8 +457,8 @@
                           "false as rolcanlogin, "
                           "-1 as rolconnlimit, "
                           "null::text as rolpassword, "
-                          "null::abstime as rolvaliduntil "
-                          "null "
+                          "null::abstime as rolvaliduntil, "
+                          "null as rolcomment "
                           "FROM pg_group");

     res = executeQuery(conn, buf->data);

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: proposal - plpgsql: execute using into
Next
From: Peter Eisentraut
Date:
Subject: Re: -HEAD pg_dumpall broken against older backends