Skip site navigation (1) Skip section navigation (2)

Re: Forcing connections closed

From: Juan Miguel <juanmime(at)ono(dot)com>
To: Hadley Willan <hadley(dot)willan(at)deeperdesign(dot)co(dot)nz>
Cc: "Gregory S(dot) Williamson" <gsw(at)globexplorer(dot)com>,PGSQL Admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Forcing connections closed
Date: 2004-01-29 22:36:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
You can kill the procs (connections) using kill -9 PID

For example,

ps aux | grep post

gives you a list of the postgres processes (all the active connections, 
and main postmaster). Here you can see the IP of the manchines connected 
Therefore, its easy to create an shell script for killing the connection 
of a client machine.

>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.
>On Fri, 2004-01-30 at 10:21, Gregory S. Williamson wrote:
>>pg_ctl stop    [-W] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]
>>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
>>Greg Williamson
>>GlobeXplorer LLC
>>-----Original Message-----
>>From:	Hadley Willan [mailto:hadley(dot)willan(at)deeperdesign(dot)co(dot)nz]
>>Sent:	Thu 1/29/2004 1:03 PM
>>To:	PGSQL Admin
>>Subject:	[ADMIN] Forcing connections closed
>>    How do I force postmaster to terminate active connections on other

In response to


pgsql-admin by date

Next:From: Sam Barnett-CormackDate: 2004-01-29 23:36:37
Subject: Re: Help: System requirements for postgresql 7.4.1
Previous:From: Ryan ChambersDate: 2004-01-29 21:48:22
Subject: Re: Forcing connections closed

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group