X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D3F23D1B51F for ; Thu, 18 Sep 2003 23:45:39 +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 92267-05 for ; Thu, 18 Sep 2003 20:45:10 -0300 (ADT) Received: from sd.tpf.co.jp (unknown [210.161.239.34]) by svr1.postgresql.org (Postfix) with SMTP id 829F5D1B507 for ; Thu, 18 Sep 2003 20:45:06 -0300 (ADT) Received: (qmail 18679 invoked from network); 19 Sep 2003 08:45:08 +0900 Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108) by sd2.tpf-fw-c.co.jp with SMTP; 19 Sep 2003 08:45:08 +0900 Received: from tpf.co.jp ([126.0.1.65]) by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id IAA08760; Fri, 19 Sep 2003 08:45:06 +0900 (JST) Message-ID: <3F6A43C5.27871514@tpf.co.jp> Date: Fri, 19 Sep 2003 08:46:13 +0900 From: Hiroshi Inoue X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U) X-Accept-Language: ja MIME-Version: 1.0 To: Paulo Scardine Cc: pgsql-hackers@postgresql.org, pgsql-odbc@postgresql.org, pgsql-interfaces@postgresql.org Subject: Re: [HACKERS] Killing the backend to cancel a long waiting query References: <2054.1063808792@sss.pgh.pa.us> <3F69A6DE.1050002@bigfoot.com> <007701c37e0f$4fc1b550$6101a8c0@Paulo> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/44 X-Sequence-Number: 4462 Paulo Scardine wrote: > > There are many interfaces that doesn't support canceling a long query other > than killing the application or killing the backend using the server > operational system. > > I've searched the docs, faqs and list archives; seen a lot of questions but > no answers. > > So I hacked a small pggetpid and pgkillpid C functions, and now I can learn > the backend's PID, start the query in a new thread, and kill the backend > using another connection if I want. Its ugly, I know, but worked wonderfully > with ODBC, the Delphi developers here and the users are very happy. > > Questions are: > 1) is there a better way to do that? Call SQLCancel(). regards, Hiroshi Inoue http://www.geocities.jp/inocchichichi/psqlodbc/