Re: Re: Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Re: Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions
Date
Msg-id 8663.998683259@sss.pgh.pa.us
Whole thread Raw
In response to Re: Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions  (Tomasz Zielonka <tomek@mult.i.pl>)
Responses Re: Re: Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions  (Tomasz Zielonka <tomek@mult.i.pl>)
List pgsql-bugs
Tomasz Zielonka <tomek@mult.i.pl> writes:
> It DOESN'T happen in PostgreSQL 7.1beta3
> It DOES    happen in PostgreSQL 7.1beta4 (but on a different machine)

You shouldn't be using *any* beta version anymore.  However,

'begin; select * from items; lock table items; commit;'

is deadlock-prone coding: you are first acquiring a read lock on the
items table, and then trying to upgrade to an exclusive lock.  The
fact that you get deadlocks is not a Postgres bug.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Bug #428: Another security issue with the JDBC driver.
Next
From: Tom Lane
Date:
Subject: Re: timestamps cannot be created without time zones