Skip site navigation (1) Skip section navigation (2)

Re: pg_dump's checkSeek() seems inadequate

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump's checkSeek() seems inadequate
Date: 2010-06-28 14:08:55
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Andrew Dunstan <andrew(at)dunslane(dot)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

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2010-06-28 14:19:09
Subject: Re: Keepalive for max_standby_delay
Previous:From: Robert HaasDate: 2010-06-28 14:03:02
Subject: Re: Keepalive for max_standby_delay

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group