X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C45C2D1B8F5 for ; Sun, 21 Sep 2003 05:42:59 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 15602-07 for ; Sun, 21 Sep 2003 02:42:28 -0300 (ADT) Received: from filer (12-234-86-219.client.attbi.com [12.234.86.219]) by svr1.postgresql.org (Postfix) with ESMTP id 2E0FDD1B4EA for ; Sun, 21 Sep 2003 02:42:26 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) (uid 1000) by filer with local; Sat, 20 Sep 2003 22:42:24 -0700 Date: Sat, 20 Sep 2003 22:42:24 -0700 From: Kevin Brown To: pgsql-hackers@postgresql.org Subject: Re: Killing the backend to cancel a long waiting query Message-ID: <20030921054224.GF3845@filer> Mail-Followup-To: Kevin Brown , pgsql-hackers@postgresql.org References: <2054.1063808792@sss.pgh.pa.us> <3F69A6DE.1050002@bigfoot.com> <007701c37e0f$4fc1b550$6101a8c0@Paulo> <1469.1063912128@sss.pgh.pa.us> <003701c37e19$d36687a0$6101a8c0@Paulo> <1850.1063914850@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: <1850.1063914850@sss.pgh.pa.us> Organization: Frobozzco International User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/1083 X-Sequence-Number: 44095 Tom Lane wrote: > "Paulo Scardine" writes: > >> I trust when you say "kill", you really mean "send SIGINT" ... > > > I'm sending a SIGTERM. Would SIGINT be more appropriate? > > Yes --- that would actually cancel the query, not cause the backend to > shut down. Ahh...this is very useful information. Wouldn't it be useful, though, to implement a "KILL" or "CANCEL" SQL command that takes a backend ID as its argument (and, of course, does the appropriate checks of whether you're a superuser or the owner of the backend) and sends the appropriate signal to the target backend? That would make it possible for users to kill their own runaway queries without having to run as whatever user PG is running as. -- Kevin Brown kevin@sysexperts.com