From: Paulo Scardine <paulos@cimed.ind.br>
To: pgsql-hackers@postgresql.org
Cc: pgsql-odbc@postgresql.org
Cc: pgsql-interfaces@postgresql.org
Subject: Killing the backend to cancel a long waiting query
Date: Thu, 18 Sep 2003 15:04:32 -0300
Message-ID: <007701c37e0f$4fc1b550$6101a8c0@Paulo> (raw)
References: <Pine.LNX.4.33.0309161858470.30978-100000@leary.csoft.net>
<2054.1063808792@sss.pgh.pa.us>
<3F69A6DE.1050002@bigfoot.com>
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?
2) is it safe to kill the backend this way (other than an user killing the
wrong postgres owned proccess)?
3) is this useful for anyone else?
Regards,
--
Paulo Scardine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: paulos@cimed.ind.br, pgsql-hackers@postgresql.org, pgsql-odbc@postgresql.org
Subject: Re: Killing the backend to cancel a long waiting query
In-Reply-To: <007701c37e0f$4fc1b550$6101a8c0@Paulo>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox