ow writes:
> Can you clarify how this would be better than the second option I described?
> Unless pg_restore can somehow create FK constraints differently (and more
> efficiently) than using "ALTER TABLE xxx ADD CONSTRAINT", I do not see how this
> would help.
If you you pg_dump and dump schema and data together, then there is some
magic to temporarily disable foreign key constraints. Try it out.
Perhaps you can adopt the statements to your particular restoration method
as well, if it turns out necessary.
--
Peter Eisentraut peter_e(at)gmx(dot)net