Re: pg_dump --comment?

Поиск
Список
Период
Сортировка
От Harald Fuchs
Тема Re: pg_dump --comment?
Дата
Msg-id puoeo34s1t.fsf@srv.protecting.net
обсуждение исходный текст
Ответ на pg_dump --comment?  (Chris Campbell <chris@bignerdranch.com>)
Список pgsql-hackers
In article <40BBBC40.3040804@bignerdranch.com>,
Chris Campbell <chris@bignerdranch.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Fast index build vs. PITR
Следующее
От: Shridhar Daithankar
Дата:
Сообщение: Re: Converting postgresql.conf parameters to kilobytes