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

From Jessica Richard
Subject Re: Is there a way to kill a connection from the pg_stat_activitly list?
Date
Msg-id 561035.86032.qm@web56402.mail.re3.yahoo.com
Whole thread Raw
In response to Re: Is there a way to kill a connection from the pg_stat_activitly list?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Is there a way to kill a connection from the pg_stat_activitly list?  ("Jonah H. Harris" <jonah.harris@gmail.com>)
List pgsql-admin
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...

Thanks,


Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:
>>> On Mon, Oct 15, 2007 at 12:34 PM, in message
<36e682920710151034r2aaef401m5429e460ee0ac209@mail.gmail.com>, "Jonah H.
Harris" wrote:
>
> 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.

Where does pg_ctl kill fit in?

Is TERM the normal signal to use there, too?

Should the pg_ctl docs give some guidelines on the signals?

-Kevin




---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out.

pgsql-admin by date:

Previous
From: Darren Reed
Date:
Subject: Re: Is my database now too big?
Next
From: "Jonah H. Harris"
Date:
Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list?