X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 318118B9B58 for ; Thu, 3 Feb 2005 15:11:40 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 38809-05 for ; Thu, 3 Feb 2005 15:11:26 +0000 (GMT) Received: from www.postgresql.com (unknown [200.46.204.209]) by svr1.postgresql.org (Postfix) with ESMTP id 2D2C48B9E3E for ; Thu, 3 Feb 2005 15:11:30 +0000 (GMT) Received: by www.postgresql.com (Postfix, from userid 80) id 467DC9A5818; Thu, 3 Feb 2005 15:11:26 +0000 (GMT) To: pgsql-bugs@postgresql.org Subject: BUG #1459: Connection hangs when other connection is not committed From: "Rainer Frey" Message-Id: <20050203151126.467DC9A5818@www.postgresql.com> Date: Thu, 3 Feb 2005 15:11:26 +0000 (GMT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/39 X-Sequence-Number: 10871 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.