I would like to do something like this, but it doesn't work...
CREATE FUNCTION kill(integer) RETURNS integer AS $$
DECLARE
pid ALIAS FOR $2;
BEGIN
-- Do some stuff here...
return kill TERM, pid;
END;
$$ LANGUAGE plpgsql;
Postgresql 8.3
UPGRADING is not an option, sorry...
You can't do it in PL/PgSQL, but you can in most of the other PLs:
or use PL/Python if you prefer. Or even PL/TCL.
Alternately, write a simple C extension to expose the
kill
function to SQL. It'll be quite trivial to adapt the examples in the documentation for the purpose.