Re: BUG #2308: pg_dump -a does not respect referential dependencies

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2308: pg_dump -a does not respect referential dependencies
Дата
Msg-id 17723.1141851690@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2308: pg_dump -a does not respect referential dependencies  ("Matthew George" <georgema@corp.earthlink.net>)
Ответы Re: BUG #2308: pg_dump -a does not respect referential dependencies  (Jim Nasby <decibel@decibel.org>)
Список pgsql-bugs
"Matthew George" <georgema@corp.earthlink.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

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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: BUG #2305: "No bufferspace available" error on large insert
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2307: Buckup and sequences in DEFAULT part