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 6E9C28B9E99; Fri, 4 Feb 2005 19:40:24 +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 41488-10; Fri, 4 Feb 2005 19:40:19 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id CE0F48B9E65; Fri, 4 Feb 2005 19:40:19 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1Cx9F6-0005Rx-00; Sat, 05 Feb 2005 08:35:48 +1300 Message-ID: <4203CE8D.1050301@opencloud.com> Date: Sat, 05 Feb 2005 08:35:41 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0 (X11/20041228) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Peter Eisentraut Cc: Rainer Frey , pgsql-bugs@postgresql.org, pgsql-jdbc@postgresql.org Subject: Re: BUG #1459: Connection hangs when other connection is not References: <20050203151126.467DC9A5818@www.postgresql.com> <200502041054.16723.peter_e@gmx.net> <42035480.2060707@inxmail.de> <200502041515.00657.peter_e@gmx.net> In-Reply-To: <200502041515.00657.peter_e@gmx.net> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/45 X-Sequence-Number: 10877 Peter Eisentraut wrote: > Am Freitag, 4. Februar 2005 11:54 schrieb Rainer Frey: > >>Is there any possibility to set a timeout for the lock, after which the >>ALTER TABLE statement fails, instead of remaining in wait status (when >>calling with JDBC? > > Yes, there is a statement_timeout parameter or something like that. JDBC has a couple of mechanisms that may be more portable than fiddling with statement_timeout directly: - Statement.setQueryTimeout(). This is *not* implemented by the current driver (it is a no-op), but shouldn't be too hard to implement as mapping to statement_timeout if you feel inclined to do some driver hacking. - Statement.cancel(). This is implemented by the current driver, but you will need to build your own infrastructure to handle doing the cancel from a separate thread if a query takes too long. -O