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 72EC98B9B58 for ; Fri, 4 Feb 2005 09:54:27 +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 96158-10 for ; Fri, 4 Feb 2005 09:54:22 +0000 (GMT) Received: from curie.credativ.org (credativ.com [217.160.209.18]) by svr1.postgresql.org (Postfix) with ESMTP id 727578B9B27 for ; Fri, 4 Feb 2005 09:54:24 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by curie.credativ.org (Postfix) with ESMTP id 4B80055A92; Fri, 4 Feb 2005 10:54:23 +0100 (CET) Received: from www.credativ.de (pD9500DDE.dip0.t-ipconnect.de [217.80.13.222]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by curie.credativ.org (Postfix) with ESMTP id 8595E55A90; Fri, 4 Feb 2005 10:54:21 +0100 (CET) Received: from bell.credativ.de (bell.credativ.de [172.26.14.16]) by www.credativ.de (Postfix) with ESMTP id A01271C002D; Fri, 4 Feb 2005 10:54:17 +0100 (CET) From: Peter Eisentraut To: "Rainer Frey" Subject: Re: BUG #1459: Connection hangs when other connection is not committed Date: Fri, 4 Feb 2005 10:54:16 +0100 User-Agent: KMail/1.7.1 Cc: pgsql-bugs@postgresql.org References: <20050203151126.467DC9A5818@www.postgresql.com> In-Reply-To: <20050203151126.467DC9A5818@www.postgresql.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200502041054.16723.peter_e@gmx.net> X-Virus-Scanned: by AMaViS at credativ.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/42 X-Sequence-Number: 10874 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/