From: Moiz Kothari <moizpostgres@gmail.com>
To: Jonah H. Harris <jonah.harris@gmail.com>
Cc: Jessica Richard <rjessil@yahoo.com>
Cc: Scott Marlowe <scott.marlowe@gmail.com>
Cc: Tommy Gildseth <tommy.gildseth@usit.uio.no>
Cc: pgsql-admin@postgresql.org
Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list?
Date: Wed, 17 Oct 2007 16:46:05 +0530
Message-ID: <82e1a9bd0710170416p77d67fc2sd28aa07f531450f0@mail.gmail.com> (raw)
In-Reply-To: <36e682920710160605n338de99fk300cd3062bd0417e@mail.gmail.com>
References: <dcc563d10710151034l77eddc60s7974ae84821b5124@mail.gmail.com>
<379974.90208.qm@web56402.mail.re3.yahoo.com>
<36e682920710160605n338de99fk300cd3062bd0417e@mail.gmail.com>
Hi,
Please do not use kill, it sometimes resets all the connection on your db,
you might want to use
pkill -f <string in ps -ef> to kill the connection you want to.
Regards,
Moiz Kothari
On 10/16/07, Jonah H. Harris <jonah.harris@gmail.com> wrote:
>
> On 10/16/07, Jessica Richard <rjessil@yahoo.com> wrote:
> > select pg_cancel_backend(procpid) solved half of my problem...at least
> it
> > terminated the query for that user... but it is still holding a user
> > connection in IDLE state....If I have too many of those, Postgres may
> run of
> > out of user connections....
> >
> > I already knew how to kill a connection if the connection is from the
> local
> > host. But I have many remote connections coming from different
> machines...
> > hard to kill with unix command "kill"... One time, I was testing to
> kill a
> > particular connection on a testing machine, the entrie Postgres was
> brought
> > down....
>
> That's why I said to write a C stored procedure to do it and install
> it on the server. That way you could call it the same way as
> pg_cancel_backend.
>
> > I need to find a safer, cleaner way to disconnect a user from Postgres
> when
> > needed.
>
> At this point in time, there isn't one.
>
> --
> 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/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
--
Hobby Site : http://dailyhealthtips.blogspot.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: moizpostgres@gmail.com, jonah.harris@gmail.com, rjessil@yahoo.com, scott.marlowe@gmail.com, tommy.gildseth@usit.uio.no
Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list?
In-Reply-To: <82e1a9bd0710170416p77d67fc2sd28aa07f531450f0@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox