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

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-patches by date

Next:From: Tom LaneDate: 2004-06-01 13:51:11
Subject: Re: CVS tip problems
Previous:From: Oliver ElphickDate: 2004-06-01 07:23:07
Subject: Re: CVS tip problems

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