Re: Function to kill backend - Mailing list pgsql-hackers

From Rod Taylor
Subject Re: Function to kill backend
Date
Msg-id 1080943345.56361.402.camel@jester
Whole thread Raw
In response to Function to kill backend  ("Magnus Hagander" <mha@sollentuna.net>)
List pgsql-hackers
On Fri, 2004-04-02 at 16:52, Magnus Hagander wrote:
> Hi!
>
> When debugging on win32, I've created myself a little function that I
> feel should be added to the "backend proper". While it adds a lot of
> vlaue on win32, I think it adds quite a bit of value on non-win32
> platforms as well...
>
> The function is pg_kill_backend(<pid>,<signal>). superuser-only, of
> course. Which simply sends a signal to the specified backend -
> querycancel, terminate, etc.

Nice.. My new favourite command is going to be:

SELECT pg_kill_backend(procpid, 'TERM') FROM pg_stat_activity WHERE
current_query LIKE '<IDLE>%';

--
Rod Taylor <rbt [at] rbt [dot] ca>

Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
PGP Key: http://www.rbt.ca/signature.asc

pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: just a test
Next
From: Christopher Browne
Date:
Subject: Re: PITR for replication?