Re: [PATCH] 8.5 TODO: Add comments to output indicating version of pg_dump and of the database server

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Jim Cox <shakahshakah(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>, David Fetter <david(at)fetter(dot)org>
Subject: Re: [PATCH] 8.5 TODO: Add comments to output indicating version of pg_dump and of the database server
Date: 2010-02-23 22:27:00
Message-ID: 201002232227.o1NMR0c23595@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > On Tue, Feb 23, 2010 at 1:47 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> However, has the patch actually been reviewed? pg_dump is a piece of
> >> code where it is notoriously easy for novices to do things wrong,
> >> and this is especially true for adding output that should only come out
> >> in particular cases.
>
> > It's a fairly trivial patch. I took a quick look at it. It needs
> > more than that, but I think not too much more. I think it would be
> > less effort for someone to review it and make a decision than it would
> > be to keep it as an open item for the next 6 months. But that's just
> > MHO: if the consensus is to postpone it, then let's just do that and
> > move on.
>
> Well, "trivial" and "correct" are entirely different things :-(.
> If we're still talking about
> http://archives.postgresql.org/message-id/c2ee6dbd0909270432hd7773edk144080185fb5259d@mail.gmail.com

Yes, that is the patch.

> then it is in fact printing the wrong thing for pg_dump's version.

Uh, right now it is printing:

-- pg_dump version: 9.0devel
--
-- remote database version: 9.0devel (90000)

That is in the SQL output file.

> PG_VERSION is a compiled-in constant so what you will get when examining
> an archive is pg_restore's version not pg_dump's version. This is
> no doubt fixable but it looks like the code doesn't currently bother
> to set archiveDumpVersion in the plain pg_dump code path, so it's
> not entirely trivial.

So you are saying if you run pg_restore on the SQL dump file, it doesn't
pick up the version? I didn't even know pg_restore could do that for
text dump files. In fact, I can't get it to work:

$ pg_dump -v test > /rtmp/x
...
$ pg_restore -l /rtmp/x -d test
pg_restore: [archiver] input file does not appear to be a valid archive

I obviously am missing something.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-02-23 22:30:49 Re: auto_explain log_verbose causes regression failure
Previous Message Simon Riggs 2010-02-23 22:21:03 Re: function side effects