From: | Bèrto ëd Sèra <berto(dot)d(dot)sera(at)gmail(dot)com> |
---|---|
To: | Chris Angelico <rosuav(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Terminating a rogue connection |
Date: | 2012-07-27 08:41:17 |
Message-ID: | CAKwGa_-sKaPZKjo7aTPJH7PQ8BL8=Wud-Y+94R+KnGsG+_joQA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi all,
in elderly versions, where pg_terminate_backend is missing, you'd
issue a kill -15 <pid> from the command line.
Bèrto
On 27 July 2012 09:33, Chris Angelico <rosuav(at)gmail(dot)com> wrote:
> On Fri, Jul 27, 2012 at 6:27 PM, Mark Morgan Lloyd
> <markMLl(dot)pgsql-general(at)telemetry(dot)co(dot)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
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
--
==============================
If Pac-Man had affected us as kids, we'd all be running around in a
darkened room munching pills and listening to repetitive music.
From | Date | Subject | |
---|---|---|---|
Next Message | Mark Morgan Lloyd | 2012-07-27 09:09:00 | Re: Terminating a rogue connection |
Previous Message | Chris Angelico | 2012-07-27 08:33:48 | Re: Terminating a rogue connection |