Stephen Frost <[EMAIL PROTECTED]> writes:
> * Tom Lane ([EMAIL PROTECTED]) 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

Sent via pgsql-patches mailing list (
To make changes to your subscription:

Reply via email to