Re: BUG #13523: Unexplained deadlocks (possible race condition) - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #13523: Unexplained deadlocks (possible race condition)
Date
Msg-id 20150730083805.GA3161@alap3.anarazel.de
Whole thread Raw
In response to Re: BUG #13523: Unexplained deadlocks (possible race condition)  ("Jack Douglas" <jack@douglastechnology.co.uk>)
Responses Re: BUG #13523: Unexplained deadlocks (possible race condition)  ("Jack Douglas" <jack@douglastechnology.co.uk>)
List pgsql-bugs
On 2015-07-30 09:23:10 +0100, Jack Douglas wrote:
> If parsing the INSERT aquires the RowExclusiveLock, perhaps parsing the LOCK
> statement should also aquire the lock? That would mean the following
> principle in the documentation ("...The best defense against deadlocks is
> generally to avoid them by being certain that all applications using a
> database acquire locks on multiple objects in a consistent order...",
> http://www.postgresql.org/docs/9.4/static/explicit-locking.html#LOCKING-DEAD
> LOCKS) would be possible (or at least more easily understood) when using
> SQL-language functions.

I don't think that'd help at all? The problem here is the lock upgrade
from RowExclusiveLock to the exclusive lock, and that'll not be fixed by
that proposal?

Regards,

Andres

pgsql-bugs by date:

Previous
From: "Jack Douglas"
Date:
Subject: Re: BUG #13523: Unexplained deadlocks (possible race condition)
Next
From: marko@joh.to
Date:
Subject: BUG #13528: LATERAL vs. correlated scalar subquery