Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 8C0539FA183 for ; Mon, 15 Oct 2007 14:18:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 34860-07 for ; Mon, 15 Oct 2007 14:18:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from web56406.mail.re3.yahoo.com (web56406.mail.re3.yahoo.com [216.252.111.85]) by postgresql.org (Postfix) with SMTP id 2FBBB9FA153 for ; Mon, 15 Oct 2007 14:18:25 -0300 (ADT) Received: (qmail 70872 invoked by uid 60001); 15 Oct 2007 17:18:24 -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=1r8CLZRO3In64k6el9XYBxi7/Q8+CPnAuSSk6thlXcvsa6vDAk+s848Nrapk3V0Q6kwc8r5oXADVunZPy/HAnx5qM5u9y1AQXFxYjo2ueE05Te5Aa5BSPZU6tIvrKWqJQme076wLQft3i9LCKpZ/hqiEc3xpAtEHIq4Bb0HuGe4=; X-YMail-OSG: ZVqvifEVM1m.9trD.4NUc30v9_YXemdLDFDLa8HH Received: from [198.119.134.32] by web56406.mail.re3.yahoo.com via HTTP; Mon, 15 Oct 2007 10:18:24 PDT Date: Mon, 15 Oct 2007 10:18:24 -0700 (PDT) From: Jessica Richard Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list? To: Tommy Gildseth Cc: pgsql-admin@postgresql.org In-Reply-To: <471369C9.1060301@usit.uio.no> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1711225073-1192468704=:68410" Content-Transfer-Encoding: 8bit Message-ID: <382292.68410.qm@web56406.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/124 X-Sequence-Number: 27038 --0-1711225073-1192468704=:68410 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. thanks Tommy Gildseth wrote: Jessica Richard wrote: > When you see a hanging Postgres connection (or a job running so long > and you don't want to continue any more) from > > select * from pg_stat_activity > > and you want to disconnect it, > > how do you do it? |pg_cancel_backend() |http://www.postgresql.org/docs/8.1/interactive/functions-admin.html -- Tommy Gildseth DBA, Gruppe for databasedrift Universitetet i Oslo, USIT m: +47 45 86 38 50 t: +47 22 85 29 39 ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend --------------------------------- Need a vacation? Get great deals to amazing places on Yahoo! Travel. --0-1711225073-1192468704=:68410 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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.

thanks


Tommy Gildseth <tommy.gildseth@usit.uio.no> wrote:
Jessica Richard wrote:
> When you see a hanging Postgres connection (or a job running so long
> and you don't want to continue any more) from
>
> select * from pg_stat_activity
>
> and you want to disconnect it,
>
> how do you do it?

|pg_cancel_backend()


|http://www.postgresql.org/docs/8.1/interactive/functions-admin.html

--
Tommy Gildseth
DBA, Gruppe for databasedrift
Universitetet i Oslo, USIT
m: +47 45 86 38 50
t: +47 22 85 29 39


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Need a vacation? Get great deals to amazing places on Yahoo! Travel. --0-1711225073-1192468704=:68410--