Skip site navigation (1) Skip section navigation (2)

Re: Re: Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomasz Zielonka <tomek(at)mult(dot)i(dot)pl>
Cc: PostgreSQL bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Re: Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions
Date: 2001-08-24 20:00:59
Message-ID: 8663.998683259@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Tomasz Zielonka <tomek(at)mult(dot)i(dot)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

In response to

Responses

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2001-08-24 20:02:09
Subject: Re: timestamps cannot be created without time zones
Previous:From: Tom LaneDate: 2001-08-24 19:52:31
Subject: Re: timestamps cannot be created without time zones

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group