From: Jessica Richard <rjessil@yahoo.com>
To: 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: Tue, 16 Oct 2007 05:03:30 -0700 (PDT)
Message-ID: <379974.90208.qm@web56402.mail.re3.yahoo.com> (raw)
In-Reply-To: <dcc563d10710151034l77eddc60s7974ae84821b5124@mail.gmail.com>
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....
I need to find a safer, cleaner way to disconnect a user from Postgres when needed.
Thanks a lot,
Scott Marlowe <scott.marlowe@gmail.com> wrote: On 10/15/07, Jessica Richard 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.
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: 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: <379974.90208.qm@web56402.mail.re3.yahoo.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