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

Re: How to disconnect client from Server forcefully

From: Andrew Hammond <ahammond(at)ca(dot)afilias(dot)info>
To: bala srini <bala(dot)srini(at)rediffmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How to disconnect client from Server forcefully
Date: 2004-08-23 15:14:09
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Hash: SHA1

bala srini wrote:
| Hi All
|   Can anyone help me reg the below mail?
|   Assuming the environment is thru the terminal i.e by setting the
PGHOST varaible to server machine and then invoking the command "psql"
from client machine.
| Thanks & Regards
| Bala.
| On Fri, 20 Aug 2004 bala srini wrote :
|>Assuming that the enviroment of establishing the connection in client
may be anything.  I want to terminate these remote connections from
server side.
|>I referred killing the process in server side. this porcess is
corresponding to the client connsction. After killing also, Client will
respawn the connection.

0) Use pg_who to identify the offending connection and it's source.
Assume it's connecting from host as user "naughty" to
database "widgets".

1) Add a rule blocking access to your pg_hba ruleset:

host   widgets   naughty   reject

2) Tell the postmaster to re-read config files. This adds your new
pg_hba rule.

pgctl reload

3) Use pg_who (not part of default distro, but available on gborg IIRC)
and kill the offending process.

The offending process will now fill your log files with failed
re-connect notices.

- --
Andrew Hammond    416-673-4138    ahammond(at)ca(dot)afilias(dot)info
Database Administrator, Afilias Canada Corp.
CB83 2838 4B67 D40F D086 3568 81FC E7E5 27AF 4A9A
Version: GnuPG v1.2.4 (GNU/Linux)


In response to

pgsql-admin by date

Next:From: Roberto Rezende de AssisDate: 2004-08-23 15:52:26
Subject: Re: Looking for tool for Graphic Database Design
Previous:From: Cavit KeskinDate: 2004-08-23 15:12:02
Subject: TSearch2 other languages

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