Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED
Date
Msg-id 1295820643.1803.20556.camel@ebony
Whole thread Raw
In response to Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, 2011-01-23 at 16:13 -0500, Tom Lane wrote:
> Simon Riggs <simon@2ndQuadrant.com> writes:
> > You can add an FK without an initial check, but the FK is enforced for
> > all further DML changes.
> 
> I seem to recall pointing out upthread that the FK check triggers are
> designed on the assumption that the constraint does hold currently.
> Has any analysis been done on exactly how badly they'll fail when it
> doesn't hold?  I remain unconvinced that this behavior is desirable.

If you mean RESTRICT relationships, then yes.

I haven't foreseen other problems myself. What other ideas or risks
would you like me to confirm or deny for you? 

-- Simon Riggs           http://www.2ndQuadrant.com/books/PostgreSQL Development, 24x7 Support, Training and Services



pgsql-hackers by date:

Previous
From: Daniel Farina
Date:
Subject: Re: One Role, Two Passwords
Next
From: Jan Urbański
Date:
Subject: wildcard search support for pg_trgm