Skip site navigation (1) Skip section navigation (2)

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

From: Jessica Richard <rjessil(at)yahoo(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
Cc: 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 11:56:00
Message-ID: 561035.86032.qm@web56402.mail.re3.yahoo.com (view raw or flat)
Thread:
Lists: 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(dot)Grittner(at)wicourts(dot)gov> wrote: >>> On Mon, Oct 15, 2007 at 12:34 PM, in message
<36e682920710151034r2aaef401m5429e460ee0ac209(at)mail(dot)gmail(dot)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.

In response to

Responses

pgsql-admin by date

Next:From: Sofer, YuvalDate: 2007-10-16 11:56:25
Subject: when inserting to table, text type parameter become NULL (after big assignment to this parameter)
Previous:From: Darren ReedDate: 2007-10-16 06:33:11
Subject: Re: Is my database now too big?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group