The following bug has been logged online:
Bug reference: 1459
Logged by: Rainer Frey
Email address: rainer.frey@inxmail.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.