pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rainer Frey <rainer.frey@inxmail.de>
To: pgsql-bugs@postgresql.org
Subject: BUG #1459: Connection hangs when other connection is not committed
Date: Thu,  3 Feb 2005 15:11:26 +0000 (GMT)
Message-ID: <20050203151126.467DC9A5818@www.postgresql.com> (raw)


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.



view thread (6+ messages)  latest in thread

Message-ID: <20050203151126.467DC9A5818@www.postgresql.com>
Permalink:  ../20050203151126.467DC9A5818@www.postgresql.com/
Also on:    postgresql.org/message-id/20050203151126.467DC9A5818@www.postgresql.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: rainer.frey@inxmail.de, pgsql-bugs@postgresql.org
  Subject: Re: BUG #1459: Connection hangs when other connection is not committed
  In-Reply-To: <20050203151126.467DC9A5818@www.postgresql.com>
  References: <20050203151126.467DC9A5818@www.postgresql.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox