Re: Postgresql 8.0 and Cancel/Kill backend functions

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Stuart Bishop" <stuart(at)stuartbishop(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Postgresql 8.0 and Cancel/Kill backend functions
Date: 2005-01-17 09:19:48
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE47661D@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > The cancel function is implemented. See
> >
> http://developer.postgresql.org/docs/postgres/functions-admin.html#FUN
> > CT
> > IONS-ADMIN-SIGNAL-TABLE.
> >
> > Kill function was considered too dangerous.
>
> Pity - I would have loved this for my test harnesses. I need
> to drop and recreate the database between each test and,
> unless I can kill them, a test that fails to close a
> connection victimizes all subsequent tests.
>
> (But not a showstopper in our case - we replace the connect
> method with a wrapper and have the harnesses keep track of
> the connection. This only leaves connections opened by
> spawned processes a problem.)
>
> It would be great if this was available as an external method
> I could install into a particular database. Hmm... I guess it
> wouldn't be difficult to write this - it would simply involve
> selecting the procpid from pg_stat_activity and sending a
> kill signal to it, wouldn't it?

Yes, if you can do it from the same machine. If you want a functino that
works across the network, you can look at the code for the cancel
functino and create a copy that just sends a different signal.

//Magnus

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-01-17 09:25:51 Re: Cursor bug?
Previous Message Magnus Hagander 2005-01-17 09:04:29 Re: Problem with win32 installer for PG 8.0