Re: BUG #1459: Connection hangs when other connection is not committed - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: BUG #1459: Connection hangs when other connection is not committed
Date
Msg-id 200502041054.16723.peter_e@gmx.net
Whole thread Raw
In response to BUG #1459: Connection hangs when other connection is not committed  ("Rainer Frey" <rainer.frey@inxmail.de>)
Responses Re: BUG #1459: Connection hangs when other connection is not  (Rainer Frey <rainer.frey@inxmail.de>)
List pgsql-bugs
Am Donnerstag, 3. Februar 2005 16:11 schrieb Rainer Frey:
> A select should not lock a table even when it is not committed.

The SELECT obtains a read (shared) lock on the table, but the ALTER TABLE
requires a write (exclusive) lock.  This is certainly necessary because you
don't want the structure of the table to be changed while you are reading it.
Additionally, the locking protocol requires that all locks once obtained need
to be held until the end of the transaction.  Both of these issues together
explain the problem you are seeing.  There is nothing that can be done about
it.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

pgsql-bugs by date:

Previous
From: Michael Meskes
Date:
Subject: Re: BUG #1440: ecpg seg faults
Next
From: Peter Eisentraut
Date:
Subject: Re: BUG #1459: Connection hangs when other connection is not committed