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

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: "shakahshakah(at)gmail(dot)com" <shakahshakah(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 8.5 TODO: Add comments to output indicating version of pg_dump and of the database server
Date: 2009-11-29 01:38:06
Message-ID: 4B11D07E.6050407@rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

shakahshakah(at)gmail(dot)com wrote:
> -- PostgreSQL database dump
> --
> -- pg_dump version: 8.5devel
> --
> -- remote database version: 8.5devel (80500)
> --
>

FWIW, and I havent read the entire thread, but pg_dump already *stores*
this information in a custom format. Try:

pg_dump -Fc blah
pg_restore -L ...

and you will get something like:

;
; Archive created at Sun Nov 29 12:34:24 2009
; dbname: blah
; TOC Entries: 202
; Compression: -1
; Dump Version: 1.10-0
; Format: CUSTOM
; Integer: 4 bytes
; Offset: 8 bytes
; Dumped from database version: 8.0.3
; Dumped by pg_dump version: 8.0.3
;

so, all that is needed is to add the relevant statements into the output
code.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2009-11-29 01:40:43 Re: Timezones (in 8.5?)
Previous Message Robert Haas 2009-11-29 01:34:16 Re: Application name patch - v4