Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 1356D1337B39 for ; Tue, 4 Jan 2011 18:47:59 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 11141-06 for ; Tue, 4 Jan 2011 22:47:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out-0.mx.aerioconnect.net (out-0-29.mx.aerioconnect.net [216.240.47.89]) by mail.postgresql.org (Postfix) with ESMTP id B53DD1337B4A for ; Tue, 4 Jan 2011 18:47:51 -0400 (AST) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id p04Mlof4004507; Tue, 4 Jan 2011 14:47:50 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from [192.168.1.128] (75-149-45-155-sfba.hfc.comcastbusiness.net [75.149.45.155]) by idiom.com (Postfix) with ESMTP id 58A452D6015; Tue, 4 Jan 2011 14:47:49 -0800 (PST) Message-ID: <4D23A38D.1010700@obviously.com> Date: Tue, 04 Jan 2011 14:47:41 -0800 From: Bryce Nesbitt User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101206 SeaMonkey/2.0.11 MIME-Version: 1.0 To: pgsql-sql@postgresql.org CC: Michael Glaesemann Subject: Re: " in transaction" can't be killed with pg_cancel_backend(). Is it a bug? References: <4D239F51.2000102@obviously.com> <6EEECA52-4293-405D-8124-A04A02D40F3E@seespotcode.net> In-Reply-To: <6EEECA52-4293-405D-8124-A04A02D40F3E@seespotcode.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201101/2 X-Sequence-Number: 34949 Michael Glaesemann wrote: > On Jan 4, 2011, at 17:29, Bryce Nesbitt wrote: > >> Should I expect pg_cancel_backend() to work in a case like this? If not does this sound like a reportable bug? >> > pg_cancel_backend() cancels the running query for that backend. In the case of, there is no running query for that backend. > > Likely you're looking for pg_terminate_backend(). > Michael Glaesemann > grzm seespotcode net > Hmm, yes. Though it seems to not be in the documentation, or, for that matter, the current code: utils/adt/misc.c #*ifdef* NOT_USED //* Disabled in 8.0 due to reliability concerns; FIXME someday *// *pg_terminate_backend*(PG_FUNCTION_ARGS # select pg_terminate_backend(5); ERROR: function pg_terminate_backend(integer) does not exist LINE 1: select pg_terminate_backend(5); ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.