"Matthew George" <georgema(at)corp(dot)earthlink(dot)net> writes:
> Since the logic obviously exists within pg_dump already to arrange the data
> in the correct order of reference dependencies, can this be added to the
> code path for `pg_dump -a` as well?
No. In a data-only restore there may not be *any* ordering that works
--- consider circular dependencies.
The best practice is to do standard schema+data dumps, wherein the
ordering problem can be handled properly by not creating the FK
constraints until after the data is loaded. If you really want to
do a data-only restore, I'd suggest dropping the FK constraints
and re-adding them afterwards (which will be a lot faster than
row-by-row retail checks would be, anyway).
Another possibility is the --disable-triggers option, but I can't
really recommend that, because if there are any referential problems
in the data you load, that way will fail to catch it.
regards, tom lane
In response to
pgsql-bugs by date
|Next:||From: Tom Lane||Date: 2006-03-08 21:10:49|
|Subject: Re: BUG #2307: Buckup and sequences in DEFAULT part |
|Previous:||From: John R Pierce||Date: 2006-03-08 20:35:25|
|Subject: Re: BUG #2305: "No bufferspace available" error on large insert|