Re: referential integrity without trigger - Mailing list pgsql-general

From Tom Lane
Subject Re: referential integrity without trigger
Date
Msg-id 5574.1139525609@sss.pgh.pa.us
Whole thread Raw
In response to referential integrity without trigger  (Alexander Presber <aljoscha@weisshuhn.de>)
List pgsql-general
Alexander Presber <aljoscha@weisshuhn.de> writes:
> Is there a clever, general scheme to "recheck"  and enforce foreign
> key contraints, after the responsible triggers have been disabled and
> reenabled?

Drop the constraint (keep your fingers off the trigger, thank you ;-)).
Modify the master table.  Re-create the constraint before committing.
ALTER TABLE ADD FOREIGN KEY does this about as fast as any ad-hoc idea
you might come up with.

            regards, tom lane

pgsql-general by date:

Previous
From: "Chandra Sekhar Surapaneni"
Date:
Subject: Re: Update table with data from another table
Next
From: "Gonzalo Villegas"
Date:
Subject: Insert more than one t-uple in a single sql