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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Chris Browne <cbbrowne(at)acm(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED
Date: 2011-01-23 21:13:07
Message-ID: 3030.1295817187@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-01-23 21:20:07 Re: pg_dump directory archive format / parallel pg_dump
Previous Message Simon Riggs 2011-01-23 20:59:22 Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED