Re: pg_dump's checkSeek() seems inadequate - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_dump's checkSeek() seems inadequate
Date
Msg-id 26772.1277734135@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump's checkSeek() seems inadequate  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: pg_dump's checkSeek() seems inadequate  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Tom Lane wrote:
>>>> echo 'some custom header' >pg.dump
>>>> pg_dump -Fc >>pg.dump

> IIRC pg_restore expects the archive to begin with the header and TOC 
> produced by pg_dump. Maybe I'm being dense, but I'm not able to see how 
> prefixing that with something else could possibly do something useful or 
> workable.

You'd have to do something like
(1) open the file as stdin(2) read the custom header(3) exec pg_restore, telling it to read stdin

A possible application for this would be for the header to contain
information needed to prepare pg_restore's arguments, like where to
contact the server.  I still think it's a bit too klugy to justify
the effort though.

In a more abstract sense, what this would be is basically a custom
label for a dump file.  I could see that being useful, but if we
wanted to support it then it ought to be an actual Feature and not
a kluge like this.  Something like
pg_dump --label 'any string' ... other args ...
pg_restore --print-label dump.file
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Keepalive for max_standby_delay
Next
From: Tom Lane
Date:
Subject: Re: Keepalive for max_standby_delay