Re: BUG #4648: needless deadlock on tables having foreign-key

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Konstantin <kostya2702(at)rambler(dot)ru>, PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #4648: needless deadlock on tables having foreign-key
Date: 2009-02-12 19:04:45
Message-ID: 15036.1234465485@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Konstantin 2009-02-12 23:31:06 Re: BUG #4648: needless deadlock on tables having foreign-key
Previous Message John R Pierce 2009-02-12 18:53:30 Re: BUG #4646: Default password is patently absurd