Re: pg_dump --comment?

From: Harald Fuchs <hf517(at)protecting(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump --comment?
Date: 2004-06-01 08:10:38
Message-ID: puoeo34s1t.fsf@srv.protecting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

In article <40BBBC40(dot)3040804(at)bignerdranch(dot)com>,
Chris Campbell <chris(at)bignerdranch(dot)com> writes:

> Harald Fuchs wrote:
>> Why don't you just do
>> ( echo "-- This is my comment"
>> pg_dump whatever
>> ) > dumpfile
>> ?

> How could I dump using the custom format, and then use "dumpfile" with
> pg_restore to restore the dump? If I just prepend the comment to the
> file, then pg_restore will choke, since the file won't be in the
> proper custom format. I would have to remove the comment before
> sending the file to pg_restore. Is there an easy way to do that? That
> can be easily automated, and not take a huge amount of time given a 4
> gig dump file that must be modified?

Since pg_restore is able to read from standard input, that should not
be a problem: instead of

pg_restore options dumpfile

just do

sed 1d dumpfile | pg_restore options

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shridhar Daithankar 2004-06-01 08:42:39 Re: Converting postgresql.conf parameters to kilobytes
Previous Message Simon Riggs 2004-06-01 08:10:16 Re: Fast index build vs. PITR

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-06-01 13:51:11 Re: CVS tip problems
Previous Message Oliver Elphick 2004-06-01 07:23:07 Re: CVS tip problems