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

From Greg Stark
Subject Re: Avoiding deadlocks ...
Date
Msg-id AANLkTinrER_07juUcO9FJraya_0dr_QfHx9e-Coa6wP3@mail.gmail.com
Whole thread Raw
In response to Avoiding deadlocks ...  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Avoiding deadlocks ...
List pgsql-hackers
On Thu, Aug 19, 2010 at 11:51 PM, 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>

>                        update order where orderid = 5;
> ... deadlock error.
>

Do you actually get a prompt here to type this command?

--
greg


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: git: uh-oh
Next
From: "Kevin Grittner"
Date:
Subject: Re: Avoiding deadlocks ...