Re: pg_dump additional options for performance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump additional options for performance
Дата
Msg-id 24327.1217094186@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_dump additional options for performance  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: pg_dump additional options for performance  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: pg_dump additional options for performance  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-patches
Stephen Frost <sfrost@snowman.net> writes:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> This argument is nonsense.  The typical usage of this capability, IMHO,
>> will be
>>
>> pg_dump -Fc >whole.dump
>> pg_restore --schema-before-data whole.dump >before.sql
>> pg_restore --data-only whole.dump >data.sql
>> pg_restore --schema-after-data whole.dump >after.sql
>>
>> followed by editing the schema pieces and then loading.

> I dislike, and doubt that I'd use, this approach.  At the end of the
> day, it ends up processing the same (very large amount of data) multiple
> times.

Well, that's easily avoided: just replace the third step by restoring
directly to the target database.

pg_restore --schema-before-data whole.dump >before.sql
edit before.sql
pg_restore --schema-after-data whole.dump >after.sql
edit after.sql
psql -f before.sql target_db
pg_restore --data-only -d target_db whole.dump
psql -f after.sql target_db

            regards, tom lane

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: pg_dump additional options for performance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump additional options for performance