Re: Suspend Referential Integrity?

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Suspend Referential Integrity?
Дата
Msg-id 20050815173119.GA1211@wolff.to
обсуждение исходный текст
Ответ на Suspend Referential Integrity?  (Jim Jarrett <jarrett@rpa.net>)
Ответы Re: Suspend Referential Integrity?  (Sean Davis <sdavis2@mail.nih.gov>)
Список pgsql-novice
On Mon, Aug 08, 2005 at 09:49:38 -0400,
  Jim Jarrett <jarrett@rpa.net> wrote:
> I'm trying to load a database ported from Oracle.  The commands I was given to
> load data into the table are in alphabetical order; when I run them, I get
> errors because I'm violating RI rules (eg. table "CUSTOMER" has RI to "SOURCE",
> but CUSTOMER attempts to load before SOURCE).
>
> Certainly, I could try to reorder the load statements, but that would be just a
> huge PITA.  Is there a way to temporarily suspend RI on a PostgreSQL
> database/schema, and then "fix it later?" Either delete the rows that break
> rules or add rows to fix the violations?

For an initial load the best thing is probably to not include the foreign key
constraints in the initial table definitions and add them at the end of the
load using alter table commands.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: restart postgres 7.3.2 problem
Следующее
От: Sean Davis
Дата:
Сообщение: Re: Suspend Referential Integrity?