Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 7107F9FB3DA for ; Tue, 16 Oct 2007 09:03:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 06903-06 for ; Tue, 16 Oct 2007 09:03:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from web56402.mail.re3.yahoo.com (web56402.mail.re3.yahoo.com [216.252.111.81]) by postgresql.org (Postfix) with SMTP id 78EDF9FB33A for ; Tue, 16 Oct 2007 09:03:31 -0300 (ADT) Received: (qmail 90235 invoked by uid 60001); 16 Oct 2007 12:03:30 -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=dboYuIvRrHdwWcC4Rwvj3vkkFiuvxlgEVJdgHQdmR5V1WXWjW2kqKRCBGi3FAHB1XoteF0oOFVut8ncvruvUGqGJgUvQLaHeZHlfVxfw0vT6ure//jj8TfwjVJcQdvB4a7dgV3ylvu/7OpG4PJ1+5bpS1vkXzW2YBwAJb0Lvd/Q=; X-YMail-OSG: x.DS0KYVM1m.NF8Sn_jcprPfwM7cwo.p8J_lu0jFqjK9FcNTRnkJ18.CvznhAd.0K9KB4fI3DdTuHVsjnvYl8KVBtyX_7m85I8vYd_NSWq1RWbB4SttpsN6faU7Faoq1nGA0Ipptm45uuxyFTSPBjypXvQ-- Received: from [198.119.134.32] by web56402.mail.re3.yahoo.com via HTTP; Tue, 16 Oct 2007 05:03:30 PDT Date: Tue, 16 Oct 2007 05:03:30 -0700 (PDT) From: Jessica Richard Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list? To: Scott Marlowe Cc: Tommy Gildseth , pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-454119703-1192536210=:90208" Content-Transfer-Encoding: 8bit Message-ID: <379974.90208.qm@web56402.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/140 X-Sequence-Number: 27054 --0-454119703-1192536210=:90208 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 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.