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

From: Jim Cox <shakahshakah(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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: 2009-09-27 11:32:41
Message-ID: c2ee6dbd0909270432hd7773edk144080185fb5259d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Sep 26, 2009 at 6:48 PM, David Fetter <david(at)fetter(dot)org> wrote:
> On Sat, Sep 26, 2009 at 11:02:55PM +0300, Peter Eisentraut wrote:
>> On Fri, 2009-09-25 at 16:59 -0400, Tom Lane wrote:
>> > "shakahshakah(at)gmail(dot)com" <shakahshakah(at)gmail(dot)com> writes:
>> > > From pg_dump/pg_restore section (9.2 of the Todo page on the
>> > > PostgreSQL Wiki), is the following item "Add comments to output
>> > > indicating version of pg_dump and of the database server" simply
>> > > asking for a change to the pg_dump header from:
>> >
>> > I think so, but what's not clear is whether this is a good idea to
>> > do in the default output.  It might only be appropriate in
>> > "verbose" mode, so as not to introduce unnecessary diffs between
>> > logically identical dumps.
>>
>> Well, a diff of the same database made by different (major) versions
>> of pg_dump will already be different in most situations, so adding
>> the pg_dump version number in it is essentially free from this
>> perspective.
>>
>> What is the use case for adding the server version?
>
> There have been cases where pg_restore doesn't fix infelicities.  For
> example, there was a time when it was a good idea to run adddepend
> after the reload.  Knowing what server version the dump came from
> could be handy for this kind of case.
>
>> I can imagine something like wanting to know exactly where the dump
>> came from, but then host name and such would be better.  (And then
>> you can infer the server version from that.)
>
> You can infer the server version until the next upgrade, at which
> point the information is lost.
>
> Cheers,
> David.

Attached s/b a patch for the 8.5 TODO "Add comments to output indicating version
of pg_dump and of the database server" (pg_dump/pg_restore section, 9.2).

In verbose mode, pg_dump version and remote database version now appear
in the "plain" output format.

For example, original verbose output:
--
-- PostgreSQL database dump
--

-- Started on 2009-09-27 11:05:52 UTC

SET statement_timeout = 0;
[...etc...]

New verbose output:
--
-- PostgreSQL database dump
--

--
-- pg_dump version: 8.5devel
--
-- remote database version: 8.1.3 (80103)
--

-- Started on 2009-09-27 11:05:52 UTC

SET statement_timeout = 0;
[...etc...]

Attachment Content-Type Size
add_pgdump_and_db_versions_v1.patch text/x-patch 858 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2009-09-27 11:59:27 Re: Hot Standby 0.2.1
Previous Message Heikki Linnakangas 2009-09-27 10:57:38 Re: Hot Standby on git