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 10574.1234454074@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>)
Responses Re: BUG #4648: needless deadlock on tables having foreign-key  (Konstantin <kostya2702@rambler.ru>)
List pgsql-bugs
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Hmm, the first UPDATE should've blocked already. It should've fired a RI
> trigger to lock the parent tuple in shared mode, but it looks like
> that's not happening for some reason.

Read the special code in AfterTriggerSaveEvent.  This behavior is
exactly what is expected --- since the referencing field didn't
change, only the second update attempt actually fires the trigger.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #4648: needless deadlock on tables having foreign-key
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #4649: unclear in create trigger - complete example