Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 07070634DF4 for ; Tue, 20 Apr 2010 11:44:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 75684-01-8 for ; Tue, 20 Apr 2010 14:44:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from jonah.setonhome.org (mail.setonhome.org [76.3.225.43]) by mail.postgresql.org (Postfix) with ESMTP id B1936635940 for ; Tue, 20 Apr 2010 10:53:20 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by jonah.setonhome.org (Postfix) with ESMTP id 1DF8D6CC709 for ; Tue, 20 Apr 2010 09:53:06 -0400 (EDT) Received: from jonah.setonhome.org ([127.0.0.1]) by localhost (jonah.home.setonhome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mGFRjFyw8R0i; Tue, 20 Apr 2010 09:53:04 -0400 (EDT) Received: from [127.0.0.1] (unknown [76.3.225.44]) by jonah.setonhome.org (Postfix) with ESMTP id F0E326CC702 for ; Tue, 20 Apr 2010 09:53:04 -0400 (EDT) Message-ID: <4BCDB1B7.1010603@setonhome.org> Date: Tue, 20 Apr 2010 09:52:55 -0400 From: Lewis Kapell Organization: Seton Home Study School User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: How to disconnect a single user in Postgresql 8.2.5 from a database References: <480516.98593.qm@web28311.mail.ukl.yahoo.com> <15823.1271729409@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/271 X-Sequence-Number: 34365 pg_cancel_backend() and pg_terminate_backend() do different things. From the documentation: pg_cancel_backend(pid int) Cancel a backend's current query pg_terminate_backend(pid int) Terminate a backend On 4/19/2010 11:07 PM, Scott Marlowe wrote: > On Mon, Apr 19, 2010 at 8:10 PM, Tom Lane wrote: >> Josh Kupershmidt writes: >>> pg_terminate_backend() is just a SQL wrapper around: >>> kill -SIGTERM [backend PID] >> >>> For versions before 8.4: if you can SSH in to the server, run the >>> above on the PID of the backend your user is connected to, and that >>> should terminate their connection. >> >> The reason the function isn't there before 8.4 is that that's not >> promised to work before 8.4 ... most of the time it will work, but >> once in awhile you could get nasty side-effects. > > So, pg_cancel_backend(pid) is the 8.3 version, that may or may not > always work then, right? >