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: "Tommy Gildseth" <tommy(dot)gildseth(at)usit(dot)uio(dot)no>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list?
Date: 2007-10-15 17:34:50
Message-ID: 36e682920710151034r2aaef401m5429e460ee0ac209@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 10/15/07, Jessica Richard <rjessil(at)yahoo(dot)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(dot)harris(at)enterprisedb(dot)com
Edison, NJ 08837 | http://www.enterprisedb.com/

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2007-10-15 18:13:23 Re: Is there a way to kill a connection from the pg_stat_activitly list?
Previous Message Scott Marlowe 2007-10-15 17:34:27 Re: Is there a way to kill a connection from the pg_stat_activitly list?