Re: BUG #4648: needless deadlock on tables having foreign-key - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4648: needless deadlock on tables having foreign-key
Date
Msg-id 15036.1234465485@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #4648: needless deadlock on tables having foreign-key  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-bugs
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Hmm, the comment specifically talks about deferrable RI checks. I wonder
> if we could skip that when there's no deferred triggers queued?

The point of the comment is that if the FK isn't deferred then it will
have been executed already (at completion of the preceding INSERT).
I'd be a bit worried about relying on that, though, because of nested
query scenarios (eg, ON INSERT trigger fires an update on some
previously-inserted row) and the possibility of deferral status changing
intra-transaction.

            regards, tom lane

pgsql-bugs by date:

Previous
From: John R Pierce
Date:
Subject: Re: BUG #4646: Default password is patently absurd
Next
From: Konstantin
Date:
Subject: Re: BUG #4648: needless deadlock on tables having foreign-key