Re: How to turn off referential integrity

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pam Wampler <Pam_Wampler(at)taylorwhite(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to turn off referential integrity
Date: 2002-04-08 19:20:39
Message-ID: 22837.1018293639@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Pam Wampler <Pam_Wampler(at)taylorwhite(dot)com> writes:
> I am using Postgresql 7.2 -- I would like to know how to turn off the
> referential integrity of tables so that I can
> do a bulk load & then turn the referential integrity back on.

There's a little dance you can do involving disabling and then
re-enabling the triggers that enforce RI. The easiest example is
to do a "pg_dump -a" (data only) dump from a small table and look
to see how pg_dump does it. IIRC, you don't need to touch the
triggers themselves, just hit the pg_class field that says whether
the table has triggers.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2002-04-08 20:09:34 Re: table vs. column constraints
Previous Message Joshua b. Jore 2002-04-08 18:27:28 Re: How to turn off referential integrity