Tom Lane wrote:
>
> If you don't mind plastering a "use at your own risk" sign on it, then
> go for it.
killing a backend is obviously much more "at your own risk" than a
descent function.
Taken from your mail, I understand that a killed backend might leave
some loose ends, eg. open locks, which would degrade the cluster's
performance. Still, it should not corrupt the shared mem, just leave it
as if the backend's still alive and sleeping, right?
You'd kill a backend only if your complete cluster is suffering from it,
and you hope to keep it running by just shooting that process. If the
cluster still has that uncleaned locks or so, you're unlucky and need to
shutdown the cluster.
Maybe we should supply a restricted version of pg_terminate_backend
that's callable from admin interfaces only so we can make sure that the
user was warned what he's doing before the termination is executed,
something like that:
ticket := select pg_admin_ticket();
/* calculate well-known stuff on ticket
and issue before it times out */
select pg_terminate_backend(ticket_hash);
Regards,
Andreas