Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 7A6FF9FB34B for ; Tue, 16 Oct 2007 09:00:21 -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 76092-02 for ; Tue, 16 Oct 2007 08:59:54 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.224]) by postgresql.org (Postfix) with ESMTP id B61499FB33A for ; Tue, 16 Oct 2007 09:00:09 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id l8so1144485nzf for ; Tue, 16 Oct 2007 05:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; 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; bh=3eoE8cVZ8kYk3bB+Y58XKsgJE1oEJVV6am0UYQKmnU0=; b=dzrCnu6LujDlWtolsnN1Q1fk8nvfLXLlELsJsZHnjfAx9FhPwuyG96305exXpCdYKALh7tbatL8uTwBlHGutw2qP6H9ng9vCa6AnopiE6NrqlNvavSeGTq+KF4pBftY1vlhobQtDbUssKtUQkTdoTaN3tE9OwohGp0e4JNiZ0BY= 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=iNpRxDaSOFHnXff3MGdIFur2FiTIXkUjK8CbqtU4oJzp/mFNsMExSF/2aCjFEzgM7eAjrlL+6Hr7i+ntS58GTYfdWb05n3iHAuIAEKli6gWBTWaefY/18dymN4anngR5LAjsXfM81lhhrzSa06OWNzOEvh/RwISgfKV7Sj+GHas= Received: by 10.142.141.5 with SMTP id o5mr1935571wfd.1192536007691; Tue, 16 Oct 2007 05:00:07 -0700 (PDT) Received: by 10.143.8.5 with HTTP; Tue, 16 Oct 2007 05:00:07 -0700 (PDT) Message-ID: <36e682920710160500u260077fbm981e12538eea2827@mail.gmail.com> Date: Tue, 16 Oct 2007 08:00:07 -0400 From: "Jonah H. Harris" To: "Jessica Richard" Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list? Cc: "Kevin Grittner" , pgsql-admin@postgresql.org, "Tommy Gildseth" In-Reply-To: <561035.86032.qm@web56402.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47136772.EE98.0025.0@wicourts.gov> <561035.86032.qm@web56402.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/139 X-Sequence-Number: 27053 On 10/16/07, Jessica Richard wrote: > If the connection is from the local machine, I can find it with "ps -ef | > grep procpid", then kill it with Unix command "kill" outside Postgres... > > But I have many remote connections coming from different machines...it is > hard to kill on the OS level outside Postgres on the postgres host... > > I am looking for something to kill a Postgres user connection within > Postgres... > Some thing like, you find the user connection with select * from > pg_stat_activity...then you pick a procpid and kill right there... Write a C stored procedure that takes a pid and calls kill(2), install it on the server, and call it from SQL. -- Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324 EnterpriseDB Corporation | fax: 732.331.1301 499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com Edison, NJ 08837 | http://www.enterprisedb.com/