Re: BUG #1459: Connection hangs when other connection is not committed

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Rainer Frey" <rainer(dot)frey(at)inxmail(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1459: Connection hangs when other connection is not committed
Date: 2005-02-04 09:54:16
Message-ID: 200502041054.16723.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-jdbc

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/

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Rainer Frey 2005-02-04 10:54:56 Re: BUG #1459: Connection hangs when other connection is not
Previous Message Michael Meskes 2005-02-04 09:49:53 Re: BUG #1440: ecpg seg faults

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Siegmar 2005-02-04 10:11:22 Re: Problems with infinity
Previous Message Kris Jurka 2005-02-04 09:27:21 Re: Problems with infinity