Re: Terminating a rogue connection

Поиск
Список
Период
Сортировка
От Chris Angelico
Тема Re: Terminating a rogue connection
Дата
Msg-id CAPTjJmpfzgqekcwXV9aseERYuuF3W7mrw50OWpy0m7mupnMZrg@mail.gmail.com
обсуждение исходный текст
Ответ на Terminating a rogue connection  (Mark Morgan Lloyd <markMLl.pgsql-general@telemetry.co.uk>)
Ответы Re: Terminating a rogue connection  (Bèrto ëd Sèra <berto.d.sera@gmail.com>)
Re: Terminating a rogue connection  (Mark Morgan Lloyd <markMLl.pgsql-general@telemetry.co.uk>)
Список pgsql-general
On Fri, Jul 27, 2012 at 6:27 PM, Mark Morgan Lloyd
<markMLl.pgsql-general@telemetry.co.uk> wrote:
> Assuming a *nix server: if a monitoring program determines that an
> established connection appears to be trying to so something inappropriate,
> what's the best way of terminating that session rapidly?

select pg_terminate_backend(procpid) from pg_stat_activity where .....

The main difficulty is recognizing which PID to terminate, though.
There's a good lot of information available in pg_stat_activity;
logins, application names, and connection IP addresses are handy here.
But ultimately, it's just pg_terminate_backend.

ChrisA

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

Предыдущее
От: Mark Morgan Lloyd
Дата:
Сообщение: Terminating a rogue connection
Следующее
От: Bèrto ëd Sèra
Дата:
Сообщение: Re: Terminating a rogue connection