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 0B0C8D1CA67 for ; Mon, 22 Sep 2003 19:05:28 +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 84563-03 for ; Mon, 22 Sep 2003 16:04:57 -0300 (ADT) Received: from angelica (unknown [200.161.129.200]) by svr1.postgresql.org (Postfix) with ESMTP id E212CD1CA8A for ; Mon, 22 Sep 2003 16:04:55 -0300 (ADT) Received: from [192.168.1.97] (helo=Paulo) by angelica with smtp (Exim 3.36 #1 (Debian)) id 1A1WFo-00052E-00; Mon, 22 Sep 2003 16:21:48 -0300 Message-ID: <05d601c3813c$2296e0c0$6101a8c0@Paulo> From: "Paulo Scardine" To: "Robert Treat" Cc: "Dave Page" , References: <20030921054224.GF3845@filer> <20030921142434.S61926-100000@houston.familyhealth.com.au><50096.80.177.99.193.1064140018.squirrel@ssl.vale-housing.co.uk> <04f301c38132$7804bc30$6101a8c0@Paulo> <1064255371.25694.1903.camel@camel> Subject: Re: Killing the backend to cancel a long waiting query Date: Mon, 22 Sep 2003 16:02:57 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/1122 X-Sequence-Number: 44134 I do not know how to do that. I learned that I can send a SIGINT to a backend to cancel a query, but I dont know how to kill just one transaction. I have only "pg_getpid" and "pg_killpid" as interfaces to system functions "getpid" and "kill". BTW, what information can I get about the current running backends on the internal structures? Or do I have to ask the OS? Thank you, -- Paulo Scardine ----- Original Message ----- From: "Robert Treat" Subject: Re: [HACKERS] Killing the backend to cancel a long waiting query > > Yes, but you may need a way to ensure that the query canceled is the > same one that you really want to cancel. (imagine come connection > pooling and bad luck mixed together so that the long running query > actually ends but another query fires up between the time you lookup the > long running query and the time you issue the kill...). maybe > transaction id as well as pid for arguments? >