On 2/28/07, Scott Marlowe <smarlowe(at)g2switchworks(dot)com> wrote:
> select procpid, usename, now()-query_start from pg_stat_activity where
> current_query like '%IDLE%' and now()-query_start > interval '5
> to list all the users that have been idle over the interval in the
> list. Using some kind of scripting language, you could then issue kill
> signals to those procpids.
There's always pg_cancel_backend().
select pg_cancel_backend(procpid) from pg_stat_activity where
current_query = '<IDLE>' and now() - query_start > interval '5
should work nicely. I've not really tested that properly though.
In response to
pgsql-general by date
|Next:||From: Shiva Sarna||Date: 2007-02-28 06:15:57|
|Subject: supporting 2000 simultaneous connections.|
|Previous:||From: Jim C. Nasby||Date: 2007-02-28 05:55:16|
|Subject: Re: Difference between UNIQUE constraint vs index|