Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: Chris Browne <cbbrowne@acm.org>, pgsql-hackers@postgresql.org
Date: 2011-01-23T21:13:07Z
Lists: pgsql-hackers
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.

			regards, tom lane