Re: -HEAD pg_dumpall broken against older backends

Lists: pgsql-patches
From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: pgsql-patches(at)postgresql(dot)org
Subject: -HEAD pg_dumpall broken against older backends
Date: 2006-03-29 13:47:12
Message-ID: 442A8FE0.6000002@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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

Attachment Content-Type Size
pg_dumpall.diff text/plain 951 bytes

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Subject: Re: -HEAD pg_dumpall broken against older backends
Date: 2006-03-29 17:34:04
Message-ID: 200603291934.04496.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Stefan Kaltenbrunner wrote:
> 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:

Dump output is never expected to be backward compatible.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Subject: Re: -HEAD pg_dumpall broken against older backends
Date: 2006-03-29 17:48:10
Message-ID: 23255.1143654490@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Stefan Kaltenbrunner wrote:
>> 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:

> Dump output is never expected to be backward compatible.

But pg_dumpall should be able to extract a dump from an older server.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Subject: Re: -HEAD pg_dumpall broken against older backends
Date: 2006-03-29 17:48:13
Message-ID: 442AC85D.4030906@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Peter Eisentraut wrote:
> Stefan Kaltenbrunner wrote:
>
>> 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:
>>
>
> Dump output is never expected to be backward compatible.
>
>

We don't expect pg_dumpall to be issuing invalid SQL at any time,
though. That's what Stefan has uncovered. The code in question is only
called when it's run against an older server.

cheers

andrew


From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: -HEAD pg_dumpall broken against older backends
Date: 2006-03-29 17:58:37
Message-ID: 442ACACD.9050103@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Peter Eisentraut wrote:
> Stefan Kaltenbrunner wrote:
>
>>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:
>
>
> Dump output is never expected to be backward compatible.

yeah - but if you take a look at the code/patch you will see that the
problem in this case is that pg_dumpall generates invalid SQL if it is
operating against an older backend which is an obvious typo/thinko in
this case.
It has nothing to do with generating backwards compatible dumps - and
using the pg_dumpall from the (newer) target version for upgrades has
been recommended for a while (or rather is documented to work in the
manual) I think.

Stefan


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: -HEAD pg_dumpall broken against older backends
Date: 2006-03-30 01:09:04
Message-ID: 442B2FB0.9000703@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Stefan Kaltenbrunner wrote:

> 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:
>
>

patch applied, thanks

andrew