X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 37B39D1D16E for ; Thu, 29 Jan 2004 21:48:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 33460-06 for ; Thu, 29 Jan 2004 17:48:29 -0400 (AST) Received: from statler.squaretrade.com (statler.squaretrade.com [216.136.217.76]) by svr1.postgresql.org (Postfix) with ESMTP id 2EC06D1CAF3 for ; Thu, 29 Jan 2004 17:48:27 -0400 (AST) Received: from [207.215.2.254] (helo=siege) by statler.squaretrade.com with esmtp (Exim 3.35 #1 (Debian)) id 1AmK1P-0007AQ-00 for ; Thu, 29 Jan 2004 13:48:23 -0800 Received: from localhost ([127.0.0.1] helo=squaretrade.com) by siege with esmtp (Exim 3.35 #1 (Debian)) id 1AmK1O-00007m-00 for ; Thu, 29 Jan 2004 13:48:22 -0800 Message-ID: <40197FA6.5040508@squaretrade.com> Date: Thu, 29 Jan 2004 13:48:22 -0800 From: Ryan Chambers User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: PGSQL Admin Subject: Re: Forcing connections closed References: <71E37EF6B7DCC1499CEA0316A25683280105762A@loki.wc.globexplorer.net> <1075411554.23417.13.camel@atlas.sol.deeper.co.nz> In-Reply-To: <1075411554.23417.13.camel@atlas.sol.deeper.co.nz> Content-Type: multipart/alternative; boundary="------------010502020603040107010100" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/281 X-Sequence-Number: 12144 This is a multi-part message in MIME format. --------------010502020603040107010100 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit It's possible to get process ids for clients using something like ps -ef | grep postgres. I wonder, is it safe to use kill to terminate those threads? If this doesn't mess up the database, it might work. Hadley Willan wrote: > Thanks for that, however that's quite heavy handed in that it will > stop the postgres instance. > > Is there any way to close connections to a database without stopping > postgres itself? > > E.G I have three databases, A,B and C, and only want to close C. > > Thanks > > On Fri, 2004-01-30 at 10:21, Gregory S. Williamson wrote: > >>/pg_ctl stop [-W] [-D DATADIR] [-s] [-m SHUTDOWN-MODE] >> >>e.g. >> >>pg_ctl stop -D /data/postgres/gex_runtime -m fast >> >>will shut down all connections and stop the postgres instance: >>Shutdown modes are: >> smart quit after all clients have disconnected >> fast quit directly, with proper shutdown >> immediate quit without complete shutdown; will lead to recovery on restart >> >>HTH, >> >>Greg Williamson >>DBA >>GlobeXplorer LLC >> >>-----Original Message----- >>From: Hadley Willan [mailto:hadley.willan@deeperdesign.co.nz] >>Sent: Thu 1/29/2004 1:03 PM >>To: PGSQL Admin >>Cc: >>Subject: [ADMIN] Forcing connections closed >> >>Hello, >> How do I force postmaster to terminate active connections on other >>databases? >> >>Thanks/ >> > -- > *Hadley Willan* *»* Director *»* _hadley.willan@deeperdesign.com_ > *»* +64(21) 28 41 463 Deeper > Design Limited *»* +64(7) 377 3328 *»* _www.deeperdesign.com_ > > > > > --------------010502020603040107010100 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit It's possible to get process ids for clients using something like ps -ef | grep postgres. I wonder, is it safe to use kill to terminate those threads? If this doesn't mess up the database, it might work.

Hadley Willan wrote:
Thanks for that, however that's quite heavy handed in that it will stop the postgres instance.

Is there any way to close connections to a database without stopping postgres itself?

E.G I have three databases, A,B and C, and only want to close C.

Thanks

On Fri, 2004-01-30 at 10:21, Gregory S. Williamson wrote:
pg_ctl stop    [-W] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]

e.g. 

pg_ctl stop -D /data/postgres/gex_runtime -m fast

will shut down all connections and stop the postgres instance:
Shutdown modes are:
  smart       quit after all clients have disconnected
  fast        quit directly, with proper shutdown
  immediate   quit without complete shutdown; will lead to recovery on restart

HTH,

Greg Williamson
DBA
GlobeXplorer LLC

-----Original Message-----
From:	Hadley Willan [mailto:hadley.willan@deeperdesign.co.nz]
Sent:	Thu 1/29/2004 1:03 PM
To:	PGSQL Admin
Cc:	
Subject:	[ADMIN] Forcing connections closed

Hello,
    How do I force postmaster to terminate active connections on other
databases?

Thanks
--
Hadley Willan » Director » hadley.willan@deeperdesign.com » +64(21) 28 41 463 Deeper Design Limited » +64(7) 377 3328 » www.deeperdesign.com
--------------010502020603040107010100--