Re: How to force disconnections from a Perl script?

Поиск
Список
Период
Сортировка
От Csaba Nagy
Тема Re: How to force disconnections from a Perl script?
Дата
Msg-id 1171903974.3101.300.camel@coppola.muc.ecircle.de
обсуждение исходный текст
Ответ на Re: How to force disconnections from a Perl script?  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: How to force disconnections from a Perl script?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
> Why irrecoverably? If the command fails, you just wait and try it
> again.

> You could use the pg_stat tables to work out who is connected and use
> pg_cancel_backend() to kill them. You could "kill -INT" them yourself.
> You could change the pg_hba.conf to forbid logging in and then bouncing
> the server.


I was going to suggest the same things you did, but then I thought
better... the OP is running the thing at night from a client box, not on
the DB, so restart and process listing is probably off limits...

There's 0 chance somebody will close at midnight it's open connection
forgotten when he left office, so wait and retry would not do any good
;-)

And pg_stat will only show you running queries, not the idle
connections.

If you only could list all the connection's pids in a client you could
loop and kill them all. Of course the loop would kill itself too if not
careful enough ;-)

Cheers,
Csaba.





В списке pgsql-general по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: How to force disconnections from a Perl script?
Следующее
От: Vivek Khera
Дата:
Сообщение: Re: open source - content management system - that uses PostGreSQL