pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonah H. Harris <jonah.harris@gmail.com>
To: Jessica Richard <rjessil@yahoo.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: Mon, 15 Oct 2007 13:34:50 -0400
Message-ID: <36e682920710151034r2aaef401m5429e460ee0ac209@mail.gmail.com> (raw)
In-Reply-To: <382292.68410.qm@web56406.mail.re3.yahoo.com>
References: <471369C9.1060301@usit.uio.no>
	<382292.68410.qm@web56406.mail.re3.yahoo.com>

On 10/15/07, Jessica Richard <rjessil@yahoo.com> 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.

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.


-- 
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/



view thread (13+ messages)  latest in thread

Message-ID: <36e682920710151034r2aaef401m5429e460ee0ac209@mail.gmail.com>
Permalink:  ../36e682920710151034r2aaef401m5429e460ee0ac209@mail.gmail.com/
Also on:    postgresql.org/message-id/36e682920710151034r2aaef401m5429e460ee0ac209@mail.gmail.com

 · 

reply

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: jonah.harris@gmail.com, rjessil@yahoo.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: <36e682920710151034r2aaef401m5429e460ee0ac209@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