Re: Is there a way to kill a connection from the pg_stat_activitly list? - Mailing list pgsql-admin

From Jonah H. Harris
Subject Re: Is there a way to kill a connection from the pg_stat_activitly list?
Date
Msg-id 36e682920710151034r2aaef401m5429e460ee0ac209@mail.gmail.com
Whole thread Raw
In response to Re: Is there a way to kill a connection from the pg_stat_activitly list?  (Jessica Richard <rjessil@yahoo.com>)
Responses Re: Is there a way to kill a connection from the pg_stat_activitly list?
List pgsql-admin
On 10/15/07, Jessica Richard <rjessil@yahoo.com> wrote:
> Thanks a lot!
>
> "select pg_cancel_backend(procpid) " can end the current query for that
> user, but then this connection becomes IDLE, still connected.
>
> Is there a command for me to totally disconnect a user by procpid? Some
> times, I need to kick out a particular Postgres user completely.

There used to be a pg_terminate_backend, but it was #ifdef'd out due
to corruption concerns.  Basically, all it did was:

kill -TERM pid

I'm not sure whether anyone has completed the research required to
know if anything remains corrupted, but it is used occasionally.  Best
to do pg_cancel_backend and then kill -TERM.


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

pgsql-admin by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list?
Next
From: "Kevin Grittner"
Date:
Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list?