Re: BUG #13523: Unexplained deadlocks (possible race condition)

From: "Jack Douglas" <jack(at)douglastechnology(dot)co(dot)uk>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13523: Unexplained deadlocks (possible race condition)
Date: 2015-07-30 08:23:10
Message-ID: 015301d0caa0$f868f2f0$e93ad8d0$@douglastechnology.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> There have been discussions of reimplementing SQL-language functions so
that parsing occurs one statement at a time, but don't hold your breath
about something happening in that direction; it doesn't seem to be a high
priority concern for anybody.

Perhaps it is worth considering a less drastic change if that is not on the
cards in the immediate future?

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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2015-07-30 08:38:05 Re: BUG #13523: Unexplained deadlocks (possible race condition)
Previous Message Alvaro Herrera 2015-07-29 16:59:55 Re: BUG #13525: Database crashed with several error messages "Could not open file "pg_multixact/members/"