Re: Is there a way to kill a connection from the pg_stat_activitly list?

From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "Jessica Richard" <rjessil(at)yahoo(dot)com>
Cc: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-admin(at)postgresql(dot)org, "Tommy Gildseth" <tommy(dot)gildseth(at)usit(dot)uio(dot)no>
Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list?
Date: 2007-10-16 12:00:07
Message-ID: 36e682920710160500u260077fbm981e12538eea2827@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 10/16/07, Jessica Richard <rjessil(at)yahoo(dot)com> wrote:
> If the connection is from the local machine, I can find it with "ps -ef |
> grep procpid", then kill it with Unix command "kill" outside Postgres...
>
> But I have many remote connections coming from different machines...it is
> hard to kill on the OS level outside Postgres on the postgres host...
>
> I am looking for something to kill a Postgres user connection within
> Postgres...
> Some thing like, you find the user connection with select * from
> pg_stat_activity...then you pick a procpid and kill right there...

Write a C stored procedure that takes a pid and calls kill(2), install
it on the server, and call it from SQL.

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah(dot)harris(at)enterprisedb(dot)com
Edison, NJ 08837 | http://www.enterprisedb.com/

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jessica Richard 2007-10-16 12:03:30 Re: Is there a way to kill a connection from the pg_stat_activitly list?
Previous Message Sofer, Yuval 2007-10-16 11:56:25 when inserting to table, text type parameter become NULL (after big assignment to this parameter)