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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

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