From rjessil@yahoo.com Mon Aug 20 20:40:49 2007 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 2F5F89F95F3 for ; Mon, 20 Aug 2007 17:40:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 14477-02 for ; Mon, 20 Aug 2007 17:40:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from web56414.mail.re3.yahoo.com (web56414.mail.re3.yahoo.com [216.252.111.93]) by postgresql.org (Postfix) with SMTP id 103E19F9580 for ; Mon, 20 Aug 2007 17:40:37 -0300 (ADT) Received: (qmail 89263 invoked by uid 60001); 20 Aug 2007 20:40:36 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=m1hlaXfdCS2McMcJ0EonQCz/Xwutneg/qh4oJkn2HYdCzFk9gEmH+25mmYyM0qa18Qap2TJszdnPA5FTQ8Bp3jO89kX/XzvWolttLoreuD1ORPhX0KIfCZ+eGhUP2NjBKr7UjIvj1gQvq9Axi6GvTWcbwKtN9X51NULNr+d6ru8=; X-YMail-OSG: 0wdHj5sVM1kmtBuG6_7WE9dvRjOBZv.lO7l08lLn2onlX5zuJm.2H8D1wXEM98uwSGr2NHSqKzCWBn6LbRrqb.bwn.HtlRrkJqQu Received: from [198.119.134.32] by web56414.mail.re3.yahoo.com via HTTP; Mon, 20 Aug 2007 13:40:35 PDT Date: Mon, 20 Aug 2007 13:40:35 -0700 (PDT) From: Jessica Richard Subject: how to kill a Postgres connection on the list of select * from pg_stat_activity? To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-669538097-1187642435=:14065" Content-Transfer-Encoding: 8bit Message-ID: <518395.14065.qm@web56414.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/233 X-Sequence-Number: 26564 --0-669538097-1187642435=:14065 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sometime a script talking to the Postgres has already been killed on the OS level, but the Postgres for this script is still listed out of select * from pg_stat_activity, saying a particular database is still being accessed by this script. How to kill (release) this connection in this case? Thanks!!! --------------------------------- Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. --0-669538097-1187642435=:14065 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sometime a script talking to the Postgres has already been killed on the OS level, but the Postgres for this script is still listed out of select * from pg_stat_activity, saying a particular database is still being accessed by this script.

How to kill (release) this connection in this case?

Thanks!!!


Boardwalk for $500? In 2007? Ha!
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. --0-669538097-1187642435=:14065-- From scott.marlowe@gmail.com Mon Aug 20 21:22:00 2007 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id D05BB9F96BA for ; Mon, 20 Aug 2007 18:22:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 32333-05 for ; Mon, 20 Aug 2007 18:21:47 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.186]) by postgresql.org (Postfix) with ESMTP id CAC369F96A4 for ; Mon, 20 Aug 2007 18:21:51 -0300 (ADT) Received: by rv-out-0910.google.com with SMTP id l15so1021383rvb for ; Mon, 20 Aug 2007 14:21:50 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nY00i9KL8FQNXYWt7310ut+v355pZEro/0s0+WlpARqI5YdnMIU7u28dpzuFj0msx5gZoflCYXrG554mZN3syVV3X3/B9PedimcP32/e6x7+tyVthmE++2xdNfMcxfPJrlfwOU2YCBYKO3peRQF62lr0RrixHhb/GFuoEVcvXp4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rNDC9gqYA+wlldSnBiAPY9fczuKmiGWw4lottZk5RbgdshMGwnRXktkkwdBTXAXKUFJhHJwJb+87wG+xG/j45A/pz8BSnNI/0ATk8ehjEODxlSCTmgrTicvpokQemSk2eyClWU2LjtDZfdvoADVu1NBMxoKagybx+6KqNPEuntI= Received: by 10.141.203.12 with SMTP id f12mr3001444rvq.1187644909608; Mon, 20 Aug 2007 14:21:49 -0700 (PDT) Received: by 10.141.98.12 with HTTP; Mon, 20 Aug 2007 14:21:49 -0700 (PDT) Message-ID: Date: Mon, 20 Aug 2007 16:21:49 -0500 From: "Scott Marlowe" To: "Jessica Richard" Subject: Re: how to kill a Postgres connection on the list of select * from pg_stat_activity? Cc: pgsql-admin@postgresql.org In-Reply-To: <518395.14065.qm@web56414.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <518395.14065.qm@web56414.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/234 X-Sequence-Number: 26565 On 8/20/07, Jessica Richard wrote: > Sometime a script talking to the Postgres has already been killed on the OS > level, but the Postgres for this script is still listed out of select * from > pg_stat_activity, saying a particular database is still being accessed by > this script. > > How to kill (release) this connection in this case? > see http://www.postgresql.org/docs/8.2/static/functions-admin.html sepcifically pg_cancel_backend(pid)