From engel306sl@yahoo.fr Mon Apr 19 11:27:20 2010 Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 251E0632B30 for ; Mon, 19 Apr 2010 08:27:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 22209-03 for ; Mon, 19 Apr 2010 11:27:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from web28311.mail.ukl.yahoo.com (web28311.mail.ukl.yahoo.com [87.248.110.130]) by mail.postgresql.org (Postfix) with SMTP id 7B2506328AB for ; Mon, 19 Apr 2010 08:27:08 -0300 (ADT) Received: (qmail 98728 invoked by uid 60001); 19 Apr 2010 11:27:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s1024; t=1271676426; bh=O/5VrqeFUR4S7G63+v2I8HVjtSZSKoH3FZkBf6TQTvg=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=c6qV2soxT56ZvSkt1UuxyeljOnOLEshAK84HvwLl5V5D3TeeG4PWjKqGkrw/sCd9DFeXIpq58ewslTgmYs7Yt+tuAxKXSO806NqGNBYjVvE6dwWNY/3y1RIV09BshpoClV2V9oYjxRdfPYC+1DsNxWNFQn9JQoOKnCN5cI1BYck= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=r2dzdsb80YZBCQQ2ZESyyNGi1FPc/JfaORnmHBInN65OJH/1xi3PDKV52zvVrjo8vhq7o+icLwLe0uKFXaKZR7lBSkL47ARe8GQ+cxTaKntjYBi1YQVNe4Rm8oavGUlS9895mGl4UTn6BiKxrYh/pHYugmjj1TWDwG5P/K1yb+s=; Message-ID: <480516.98593.qm@web28311.mail.ukl.yahoo.com> X-YMail-OSG: cz9bqnoVM1nHHdiVHUw3qfnh2f3_1wpcMqRjuQJaCPWRsvr IKOo1.MD2wX58hyC.PJV7tbBKa.r3nvZAIm7xeFW1llydSYsbX8JZJGrW_yS 0QLHASZeub6odyV884ESJrcJNPTy1v7pfWcL.SUwFZhtKylv.W2.zPCeSMkE ej6r9dfaOgeAQyU8bXhSA7o49jLEjaKLzKSmF Received: from [84.14.121.155] by web28311.mail.ukl.yahoo.com via HTTP; Mon, 19 Apr 2010 11:27:05 GMT X-Mailer: YahooMailClassic/10.1.9 YahooMailWebService/0.8.102.267879 Date: Mon, 19 Apr 2010 11:27:05 +0000 (GMT) From: Steph L Subject: How to disconnect a single user in Postgresql 8.2.5 from a database To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1241897115-1271676425=:98593" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=-10 required=5 tests=BAYES_40=-0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201004/249 X-Sequence-Number: 34343 --0-1241897115-1271676425=:98593 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable How to disconnect a single user in Postgresql 8.2.5 from a database ? =0A=0A=0A --0-1241897115-1271676425=:98593 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
How to disconnect a single user in Postgresql= 8.2.5 from a database ?

=0A=0A=0A=0A=0A --0-1241897115-1271676425=:98593-- From gray.ru@gmail.com Mon Apr 19 15:52:43 2010 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 9AC52632B9E for ; Mon, 19 Apr 2010 12:52:43 -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 30884-04 for ; Mon, 19 Apr 2010 15:52:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f46.google.com (mail-ww0-f46.google.com [74.125.82.46]) by mail.postgresql.org (Postfix) with ESMTP id EF906632A26 for ; Mon, 19 Apr 2010 12:52:32 -0300 (ADT) Received: by wwb24 with SMTP id 24so2638520wwb.19 for ; Mon, 19 Apr 2010 08:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:received:message-id:subject:to:cc:content-type; bh=rotCyo/+6GvxVkjkel0LpfxzCpO6RX9Gv+B6Oys8Eog=; b=I2Fv5QPr7Z0symQjQEzaA5W34FAuLOJYNQD77fBSknyu1gxR92Bi/dP3ugyr488Dtz lraaaLUQyeV/cjM9UPnFtx+PDjAHsbBPbP5YRcLL72Vn7+2RQTAyv24NsF2TiudFRAIg boSuVk9k0CKoyvcphkX3ioNLJrZ65jgQ3dK+o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=whEWrrTIoHmNAM2buHSlT5jun13trlzhqJM/T9h1vUt7sNt+7NtEakTKixSOZ3U2CQ yEHe4+jE7ZCl3MC2lQenV0pihdVJkWJ1idEfSKWmFT4K/dFhA6UNTq4t4sfBnBMzOIjG fy90bee1Rs2NvJewOsGJylMkox6lGY71dXrg0= MIME-Version: 1.0 Received: by 10.216.233.205 with HTTP; Mon, 19 Apr 2010 08:52:10 -0700 (PDT) In-Reply-To: <480516.98593.qm@web28311.mail.ukl.yahoo.com> References: <480516.98593.qm@web28311.mail.ukl.yahoo.com> From: Sergey Konoplev Date: Mon, 19 Apr 2010 19:52:10 +0400 Received: by 10.216.178.207 with SMTP id f57mr5658918wem.88.1271692350319; Mon, 19 Apr 2010 08:52:30 -0700 (PDT) Message-ID: Subject: Re: How to disconnect a single user in Postgresql 8.2.5 from a database To: Steph L Cc: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201004/258 X-Sequence-Number: 34352 On 19 April 2010 15:27, Steph L wrote: > > How to disconnect a single user in Postgresql 8.2.5 from a database ? AFAIK the only way is to upgrade to 8.4 and use pg_terminate_backend(): http://www.postgresql.org/docs/8.4/interactive/functions-admin.html -- Sergey Konoplev Blog: http://gray-hemp.blogspot.com / Linkedin: http://ru.linkedin.com/in/grayhemp / JID/GTalk: gray.ru@gmail.com / Skype: gray-hemp / ICQ: 29353802 From schmiddy@gmail.com Tue Apr 20 01:25:15 2010 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id A9529632C56 for ; Mon, 19 Apr 2010 22:25:15 -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 30418-06 for ; Tue, 20 Apr 2010 01:25:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qy0-f201.google.com (mail-qy0-f201.google.com [209.85.221.201]) by mail.postgresql.org (Postfix) with ESMTP id 38A05632982 for ; Mon, 19 Apr 2010 22:25:05 -0300 (ADT) Received: by qyk39 with SMTP id 39so1614567qyk.10 for ; Mon, 19 Apr 2010 18:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:received:message-id:subject:to:cc:content-type; bh=od2Kxm0xtkjbu4/42PObpxcGdeRGdD63QP3R8ZeNtTI=; b=RkGXZ0thvOjxbv3LNBk4RkrVLp6wD1eSGtk5j9FMOWRnEg+lZ5IIva5Ihmu3Id1YD2 4a/TomRKWtxXXpnUMCjEfY30YQZdFnNmgxC3LiVUFdxmd7DxGA746s4mGeOPPWgjhM+Y aeZOiYi3flPfrV/w5cBrhhsWTrFWX5U+5T72A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=ryg4Wxwn04sCq2n5zprN54uM1cWqosxOWpx+7gWsnNhL97CUwusQX0/0+wzowKMioY YC33rAJarpDMl1pjw3ORycjHZ7C6StYawWSwXSetrWlwk0fkyLY3rcAl+6V3c0+tPfMi 9JFwcPoX3XeZiU2GmU/4PJxwH0FQAqtrhzeRU= MIME-Version: 1.0 Received: by 10.229.88.3 with HTTP; Mon, 19 Apr 2010 18:24:40 -0700 (PDT) In-Reply-To: References: <480516.98593.qm@web28311.mail.ukl.yahoo.com> From: Josh Kupershmidt Date: Mon, 19 Apr 2010 21:24:40 -0400 Received: by 10.229.225.72 with SMTP id ir8mr4152337qcb.73.1271726700488; Mon, 19 Apr 2010 18:25:00 -0700 (PDT) Message-ID: Subject: Re: How to disconnect a single user in Postgresql 8.2.5 from a database To: Sergey Konoplev Cc: Steph L , pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201004/264 X-Sequence-Number: 34358 On Mon, Apr 19, 2010 at 11:52 AM, Sergey Konoplev wrote: > On 19 April 2010 15:27, Steph L wrote: >> How to disconnect a single user in Postgresql 8.2.5 from a database ? > AFAIK the only way is to upgrade to 8.4 and use pg_terminate_backend(): > http://www.postgresql.org/docs/8.4/interactive/functions-admin.html 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. Josh From tgl@sss.pgh.pa.us Tue Apr 20 02:10:23 2010 Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 3528B63265F for ; Mon, 19 Apr 2010 23:10:23 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 16590-06 for ; Tue, 20 Apr 2010 02:10:03 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 66FA96324A1 for ; Mon, 19 Apr 2010 23:10:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o3K2A9N0015824; Mon, 19 Apr 2010 22:10:10 -0400 (EDT) To: Josh Kupershmidt cc: Sergey Konoplev , Steph L , pgsql-admin@postgresql.org Subject: Re: How to disconnect a single user in Postgresql 8.2.5 from a database In-reply-to: References: <480516.98593.qm@web28311.mail.ukl.yahoo.com> Comments: In-reply-to Josh Kupershmidt message dated "Mon, 19 Apr 2010 21:24:40 -0400" Date: Mon, 19 Apr 2010 22:10:09 -0400 Message-ID: <15823.1271729409@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.165 tagged_above=-10 required=5 tests=AWL=-1.154, BAYES_20=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/265 X-Sequence-Number: 34359 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. regards, tom lane From scott.marlowe@gmail.com Tue Apr 20 03:08:19 2010 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 79ABD632EB6 for ; Tue, 20 Apr 2010 00:08:19 -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 51975-01-7 for ; Tue, 20 Apr 2010 03:08:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gw0-f46.google.com (mail-gw0-f46.google.com [74.125.83.46]) by mail.postgresql.org (Postfix) with ESMTP id 584DC633D01 for ; Tue, 20 Apr 2010 00:07:01 -0300 (ADT) Received: by gwj19 with SMTP id 19so589069gwj.19 for ; Mon, 19 Apr 2010 20:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=RCeUVSqbIZ1Wy+/Uvym+ZhLwRXyx2mlv9nXYdIuVa7g=; b=t5YlSuu9wj4wfvA0hXd0kv1dkxttquPi7huK2sBHFu216Dqb9GBZeLxKAny8jVzdj5 N1WuBh7o16lpmYYORmnfyidaZsWjXfKEsf0tzHYLMyTp2uZWu5HoDxew/qUGAizxbsF3 H3n6EnWJNIMpGlqINWyCdHdlRgp2tVAKzchKY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=lxzzRDUg13xJpuC/suki24v1KYMG0anMTloIh+lflGG7o5bnKCnMPI4GEn5ilLs0NW AHVRMQBuC7UCXkTqTdLVzGnpOLRWTqhS6/BjPau4YRTWi1A4uhdiYhzhz4oaeQ9cchdE 6H3Nlf7XylE5GXHo+s9G29+RXwNm6G+rCOqew= MIME-Version: 1.0 Received: by 10.150.218.9 with HTTP; Mon, 19 Apr 2010 20:07:00 -0700 (PDT) In-Reply-To: <15823.1271729409@sss.pgh.pa.us> References: <480516.98593.qm@web28311.mail.ukl.yahoo.com> <15823.1271729409@sss.pgh.pa.us> Date: Mon, 19 Apr 2010 21:07:00 -0600 Received: by 10.150.253.2 with SMTP id a2mr6693685ybi.42.1271732820552; Mon, 19 Apr 2010 20:07:00 -0700 (PDT) Message-ID: Subject: Re: How to disconnect a single user in Postgresql 8.2.5 from a database From: Scott Marlowe To: Tom Lane Cc: Josh Kupershmidt , Sergey Konoplev , Steph L , pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201004/266 X-Sequence-Number: 34360 On Mon, Apr 19, 2010 at 8:10 PM, Tom Lane wrote: > Josh Kupershmidt writes: >> pg_terminate_backend() is just a SQL wrapper around: >> =A0 =A0kill -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? From tgl@sss.pgh.pa.us Tue Apr 20 13:31:39 2010 Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C4EDD6332A8 for ; Tue, 20 Apr 2010 10:31:39 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 06899-04 for ; Tue, 20 Apr 2010 13:31:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 0CD236330DB for ; Tue, 20 Apr 2010 10:31:28 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o3KDVKhG025671; Tue, 20 Apr 2010 09:31:20 -0400 (EDT) To: Scott Marlowe cc: Josh Kupershmidt , Sergey Konoplev , Steph L , pgsql-admin@postgresql.org Subject: Re: How to disconnect a single user in Postgresql 8.2.5 from a database In-reply-to: References: <480516.98593.qm@web28311.mail.ukl.yahoo.com> <15823.1271729409@sss.pgh.pa.us> Comments: In-reply-to Scott Marlowe message dated "Mon, 19 Apr 2010 21:07:00 -0600" Date: Tue, 20 Apr 2010 09:31:20 -0400 Message-ID: <25670.1271770280@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.114 tagged_above=-10 required=5 tests=AWL=-0.204, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/270 X-Sequence-Number: 34364 Scott Marlowe writes: > On Mon, Apr 19, 2010 at 8:10 PM, Tom Lane wrote: >> 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? No, I didn't say that. regards, tom lane From lkapell@setonhome.org Tue Apr 20 14:44:13 2010 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? > From scott.marlowe@gmail.com Tue Apr 20 14:49:43 2010 Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 2B1E66332A8 for ; Tue, 20 Apr 2010 11:49:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 24362-04-2 for ; Tue, 20 Apr 2010 14:49:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f214.google.com (mail-gx0-f214.google.com [209.85.217.214]) by mail.postgresql.org (Postfix) with ESMTP id 22E0E636801 for ; Tue, 20 Apr 2010 11:29:10 -0300 (ADT) Received: by gxk6 with SMTP id 6so101657gxk.14 for ; Tue, 20 Apr 2010 07:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=S4hBBAAKmx+qjn4aDZMA1VxvymQsIobJW/ZnyWeU/MM=; b=V7aOpF6IZ2ycKPiu43dlUPEbCIR2WLGjwBcT/Wy2HLlqlFOEzuq/1PPwirw6q4SUW4 fHAeIlx9S6zz9VQ9IiTjzZTl5DL/NuTGcFgf162+MrLvnZJpF6/H0DcbI/EcwMpv9XbK qnfrwL5ZmPsXaodRmeZq2gc+OQxhHxtrTttxc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=cfdzefGbm3qP/C+r1rzD6N5OqSk/eHc0AA8buegyzecooSzTDKsSFJEZ9IOhZNA2jp rvw2bS6J8/WNVMu7PaiTHPNDrdxs3ymzF8FroJ2p4ZFJlsHDhN2uX3Jn+JVSe7qhECvm njoXZmuLoXN2EVe7OvGv2zIoqK7lnk/WuC4Vk= MIME-Version: 1.0 Received: by 10.150.218.9 with HTTP; Tue, 20 Apr 2010 07:29:08 -0700 (PDT) In-Reply-To: <25670.1271770280@sss.pgh.pa.us> References: <480516.98593.qm@web28311.mail.ukl.yahoo.com> <15823.1271729409@sss.pgh.pa.us> <25670.1271770280@sss.pgh.pa.us> Date: Tue, 20 Apr 2010 08:29:08 -0600 Received: by 10.151.118.9 with SMTP id v9mr7310370ybm.346.1271773748896; Tue, 20 Apr 2010 07:29:08 -0700 (PDT) Message-ID: Subject: Re: How to disconnect a single user in Postgresql 8.2.5 from a database From: Scott Marlowe To: Tom Lane Cc: Josh Kupershmidt , Sergey Konoplev , Steph L , pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.085 tagged_above=-10 required=5 tests=AWL=-0.185, BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201004/273 X-Sequence-Number: 34367 On Tue, Apr 20, 2010 at 7:31 AM, Tom Lane wrote: > Scott Marlowe writes: >> On Mon, Apr 19, 2010 at 8:10 PM, Tom Lane wrote: >>> 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? > > No, I didn't say that. Well, my experience with it has been that it's similar and it doesn't always work. From scott.marlowe@gmail.com Tue Apr 20 15:05:40 2010 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 8671B634F6B for ; Tue, 20 Apr 2010 12:05:40 -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 81318-01-9 for ; Tue, 20 Apr 2010 15:05:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f214.google.com (mail-gx0-f214.google.com [209.85.217.214]) by mail.postgresql.org (Postfix) with ESMTP id CAC36634206 for ; Tue, 20 Apr 2010 11:55:50 -0300 (ADT) Received: by gxk6 with SMTP id 6so113605gxk.14 for ; Tue, 20 Apr 2010 07:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=rgzGQ1elsovOLrjo9u2r2fw/P6A5iZBW1S0vGYX32hs=; b=bSJSQ5NsNMvdsMD2B4qbrjqsr5hC68SkgXKr3Z7g+Bu+X+ifc6iR29wAI+N1bCdor9 mGaa4BRm3XPCrjSgCPCliSYHKcnYfx7Opyb4sfzdLFuLhfY8ZGMWIYYREHjf4wFmtlNd 9h35uz4uRAqhnSKwoAoa9TxH80Af8gf+u2K4c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=u9ZcS3UuVJcfGxZDas772UtG4W9WIZ8DI8Dcbx4lnlcdJrnhk3PU1NDA9S6lILMXFd 3W/0YYQ8cGxYxVlsHBycdgmsKWUwfF6c7EoAsDPPWMyTxEhVISWzdlbdzG2WGWISqu6h kEKAGs/zAjMNRWhQTHht0uO5SL7HGt0G4JCQk= MIME-Version: 1.0 Received: by 10.150.218.9 with HTTP; Tue, 20 Apr 2010 07:55:49 -0700 (PDT) In-Reply-To: <4BCDB1B7.1010603@setonhome.org> References: <480516.98593.qm@web28311.mail.ukl.yahoo.com> <15823.1271729409@sss.pgh.pa.us> <4BCDB1B7.1010603@setonhome.org> Date: Tue, 20 Apr 2010 08:55:49 -0600 Received: by 10.150.128.36 with SMTP id a36mr7357701ybd.337.1271775349839; Tue, 20 Apr 2010 07:55:49 -0700 (PDT) Message-ID: Subject: Re: How to disconnect a single user in Postgresql 8.2.5 from a database From: Scott Marlowe To: Lewis Kapell Cc: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201004/274 X-Sequence-Number: 34368 Ahhh, ok. On Tue, Apr 20, 2010 at 7:52 AM, Lewis Kapell wrote= : > pg_cancel_backend() and pg_terminate_backend() do different things. From = the > documentation: > > pg_cancel_backend(pid int) =A0 =A0 =A0Cancel a backend's current query > pg_terminate_backend(pid int) =A0 Terminate a backend > > > > On 4/19/2010 11:07 PM, Scott Marlowe wrote: >> >> On Mon, Apr 19, 2010 at 8:10 PM, Tom Lane =A0wrote: >>> >>> Josh Kupershmidt =A0writes: >>>> >>>> pg_terminate_backend() is just a SQL wrapper around: >>>> =A0 =A0kill -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? >> > > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin > --=20 When fascism comes to America, it will be intolerance sold as diversity. From tgl@sss.pgh.pa.us Tue Apr 20 15:06:34 2010 Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 813FB633CE9 for ; Tue, 20 Apr 2010 12:06:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 29106-04-4 for ; Tue, 20 Apr 2010 15:06:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 4DDF66351EF for ; Tue, 20 Apr 2010 11:58:13 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o3KEwA7H028208; Tue, 20 Apr 2010 10:58:10 -0400 (EDT) To: Scott Marlowe cc: Josh Kupershmidt , Sergey Konoplev , Steph L , pgsql-admin@postgresql.org Subject: Re: How to disconnect a single user in Postgresql 8.2.5 from a database In-reply-to: References: <480516.98593.qm@web28311.mail.ukl.yahoo.com> <15823.1271729409@sss.pgh.pa.us> <25670.1271770280@sss.pgh.pa.us> Comments: In-reply-to Scott Marlowe message dated "Tue, 20 Apr 2010 08:29:08 -0600" Date: Tue, 20 Apr 2010 10:58:10 -0400 Message-ID: <28207.1271775490@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.112 tagged_above=-10 required=5 tests=AWL=-0.202, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/275 X-Sequence-Number: 34369 Scott Marlowe writes: > On Tue, Apr 20, 2010 at 7:31 AM, Tom Lane wrote: >> Scott Marlowe writes: >>> So, pg_cancel_backend(pid) is the 8.3 version, that may or may not >>> always work then, right? >> >> No, I didn't say that. > Well, my experience with it has been that it's similar and it doesn't > always work. pg_cancel_backend might or might not always succeed in canceling a query, if that's what you mean. What I'm worried about with SIGTERM'ing an individual backend is negative side-effects, like hanging the entire database. Before 8.4 there was never any attempt to ensure that that would work nicely, and if memory serves we did find some problems when we tested it. regards, tom lane