Re: Postgres Dump out of order

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Postgres Dump out of order
Дата
Msg-id 12482.1259765561@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Postgres Dump out of order  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-general
Craig Ringer <craig@postnewspapers.com.au> writes:
> On 2/12/2009 3:41 PM, silly8888 wrote:
>> pg_dump dumps data first and then the constraints (including FK) so
>> there shouldn't be any problems when you import the dump.

> ... assuming you're using a sufficiently recent version of pg_dump.
> Wasn't that added fairly recently?

Depends on context, which the OP provided none of.

pg_dump has handled FK dependencies -- even circular ones -- correctly
for a long time, given that you're doing a full schema+data dump.

If you ask it for a data-only dump, there is no way to handle circular
dependencies, so until recently it just threw up its hands and dumped
the tables in an arbitrary order.  Recent versions (I think probably
only 8.4.x) will order a data-only dump correctly for FK considerations
so long as there are no circular dependencies.

If you must use a data-only dump pre-8.4, I'd suggest using pg_restore's
-L switch to manually control the restore order.

            regards, tom lane

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

Предыдущее
От: Sam Jas
Дата:
Сообщение: Re: READ ONLY & I/O ERROR
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Roles with passwords; SET ROLE ... WITH PASSWORD ?