Re: Avoiding deadlocks ... - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Avoiding deadlocks ...
Date
Msg-id 4C6E70080200002500034996@gw.wicourts.gov
Whole thread Raw
In response to Re: Avoiding deadlocks ...  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> wrote:
> Josh Berkus <josh@agliodbs.com> wrote:
>> update session where id = X;
>>                        update order where orderid = 5;
>> update order where orderid = 5;
> 
> So i think this will already deadlock.
> 
> A has a exclusive-lock on session<X> and is waiting on order<5>. B
> has an exclusive lock on order<5> and is waiting on a share-lock
> on session<x>
No, see Tom's explanation on the related "Deadlock bug" thread:
http://archives.postgresql.org/pgsql-hackers/2010-08/msg01464.php
>>                        update order where orderid = 5;
>> ... deadlock error.
> 
> Do you actually get a prompt here to type this command?
Yes.  The attachment at the start of the other thread makes it easy
to confirm:
http://archives.postgresql.org/pgsql-hackers/2010-08/msg01447.php
-Kevin


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Avoiding deadlocks ...
Next
From: Alvaro Herrera
Date:
Subject: Re: small smgrcreate cleanup patch