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

From: "Rainer Frey" <rainer(dot)frey(at)inxmail(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1459: Connection hangs when other connection is not committed
Date: 2005-02-03 15:11:26
Message-ID: 20050203151126.467DC9A5818@www.postgresql.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-jdbc


The following bug has been logged online:

Bug reference: 1459
Logged by: Rainer Frey
Email address: rainer(dot)frey(at)inxmail(dot)de
PostgreSQL version: 8.0.1
Operating system: Redhat Linux 9, Kernel 2.4.20-8, AMD Sempron 2500+, 1GB
RAM
Description: Connection hangs when other connection is not committed
Details:

There seems to be a locking problem when not using autocommit. I came across
this in a relatively complex Java application, but could reproduce it with
the following scenario: (user test has priviledge to create db)
createdb -U test -W testdb
psql -U test -W testdb
CREATE TABLE test_table (id integer);
ALTER TABLE test_table ADD test integer;

now start another client session, disable autocommit:
psql -U test -W testdb
\set AUTOCOMMIT off
SELECT * FROM test_table;

Back in the first session, try to add another column:
ALTER TABLE test_table ADD test1 integer;

This hangs forever, until I commit session 2.
A select should not lock a table even when it is not committed.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Larson, Tim (Corporate) 2005-02-03 16:11:07 Re: BUG #1457: ./configure --with-openssl --enabled-thread-safety fails
Previous Message Magnus Hagander 2005-02-03 14:04:20 Re: Postgres install on windows 2003 server

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bill Schneider 2005-02-03 16:08:05 optimization for repeated values within JOINs
Previous Message Kovács Péter 2005-02-03 10:22:41 Re: Primary schema name prepended to database objects