Greg Stark <gsstark(at)mit(dot)edu> wrote:
> Josh Berkus <josh(at)agliodbs(dot)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