Re: problem with foreign keys + data-only backup

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: problem with foreign keys + data-only backup
Дата
Msg-id 48AEBF0B.2030200@archonet.com
обсуждение исходный текст
Ответ на problem with foreign keys + data-only backup  (Peter Billen <peter@clueless.be>)
Ответы Re: problem with foreign keys + data-only backup
Список pgsql-general
Peter Billen wrote:
> Hi all,
>
> I have a problem with foreign keys and data-only (no schema) backup. I
> have a simple table node (pseudo-SQL):

> When I do a data-only backup, the backup file contains following two lines:
>
> INSERT INTO NODE (node_id, parent_node_id) VALUES (2, 1);
> INSERT INTO NODE (node_id, parent_node_id) VALUES (1, NULL);
>
> Restoring the backup file into another database ofcourse fails, because
> the parent_node_id (1) in the first INSERT statement refers to an
> unknown (to be added) node (in the second statement).
>
> How do I make sure my backup orders the insert statements in a logical
> order?

You don't. You might find --disable-triggers useful though. See the
pg_restore documentation for details.

--
  Richard Huxton
  Archonet Ltd

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

Предыдущее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: Re: LIKE and SIMILAR TO
Следующее
От: Markus Mehrwald
Дата:
Сообщение: Re: problem with foreign keys + data-only backup