Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group