On Tue, Jun 30, 2009 at 11:53 PM, Isabella Ghiurea < isabella.ghiu...@nrc-cnrc.gc.ca> wrote:
> Hello PG Users, > I would like to know if there is a "clean" way to terminate running and > idle connections inside PG db ? > ( I see : pg_cancel_backend (pid) will send the connections to idle stage > but not disconnecting from db , if you have > 100 idle connections to db > and don't want to use the OS " kill " ) > > Thank you > Isabella > > > -- > ----------------------------------------------------------- > Isabella A. Ghiurea > isabella.ghiu...@nrc-cnrc.gc.ca > Canadian Astronomy Data Centre | > http://www1.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/ National Research Council of > Canada, Herzberg Institute of Astrophysics 5071 West Saanich Road, Victoria > BC V9E 2E7, Canada > Phone: 250 363-3446 fax: 250 363-0045 > > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin Hi, To kill the process and session you can do like follows: (1) Edit " pg_hba.conf " file which is in your data directory and at the bottom of the file add a line as follows: host all all <client IP address/32> reject (2)And reload the database. pg_ctl –D <your data directory path> reload (3)After that run the following command: $ pg_ctl -D <your data directory path> kill TERM <procpid> Thanks & Regards, Raghu