Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id A18389FB25F for ; Tue, 16 Oct 2007 08:56:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 70081-01 for ; Tue, 16 Oct 2007 08:55:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from web56402.mail.re3.yahoo.com (web56402.mail.re3.yahoo.com [216.252.111.81]) by postgresql.org (Postfix) with SMTP id EC9789FB256 for ; Tue, 16 Oct 2007 08:56:01 -0300 (ADT) Received: (qmail 87507 invoked by uid 60001); 16 Oct 2007 11:56:00 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=R/lwPQYZE909GpPefFabhEZhHn8r+y6T1+iTO5hEvooju6bDJ/kTWkFqwLiXcB85pUw8F1BtnQKPy5zFQCRywdJZM+PNoOqbkE58D9/lJk+pGiBIR3feu/6GlhvYN67DzqoLqjXlXq55nlwY58WHsyoUO9+3+p3CXwJ5ziT8yzY=; X-YMail-OSG: JHKo0wwVM1lqkn_EhdIDo6qCmAaDAnNBOhte6UxT05I9eYnNWPlNLEEF7wp8SE2D0LuvxYrDzIvJYoiGrs5qymQSqz0LKyYnXxNzqe9PgNqpzvvCiZeIfGJJLB6PXjkxH2pCVycab2fDoPoNwCv7aj6N Received: from [198.119.134.32] by web56402.mail.re3.yahoo.com via HTTP; Tue, 16 Oct 2007 04:56:00 PDT Date: Tue, 16 Oct 2007 04:56:00 -0700 (PDT) From: Jessica Richard Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list? To: Kevin Grittner , "Jonah H. Harris" Cc: pgsql-admin@postgresql.org, Tommy Gildseth In-Reply-To: <47136772.EE98.0025.0@wicourts.gov> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-122730445-1192535760=:86032" Content-Transfer-Encoding: 8bit Message-ID: <561035.86032.qm@web56402.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/138 X-Sequence-Number: 27052 --0-122730445-1192535760=:86032 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 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. --0-122730445-1192535760=:86032 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-122730445-1192535760=:86032--