Re: Forcing connections closed - Mailing list pgsql-admin

From Juan Miguel
Subject Re: Forcing connections closed
Date
Msg-id 40198AE2.5000808@ono.com
Whole thread Raw
In response to Re: Forcing connections closed  (Hadley Willan <hadley.willan@deeperdesign.co.nz>)
Responses Re: Forcing connections closed
Re: Forcing connections closed
List 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
from.
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.
>
>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
>>
>>
>
>
>



pgsql-admin by date:

Previous
From: Ryan Chambers
Date:
Subject: Re: Forcing connections closed
Next
From: Sam Barnett-Cormack
Date:
Subject: Re: Help: System requirements for postgresql 7.4.1