I was looking for solution like this. Actually I made a few changes
proposed by Robert Treat:
* SESSION_USER insetead of CURRENT_USER
* Added filter for username and procpid from pg_stat_activity
Alternatively you can create similar function for pg_terminate_backend - it
pid's terminates backend c
On Wednesday 28 February 2007 15:19, George Nychis wrote:
> Hey all,
>
> So the pg_cancel_backend() function by default is only available to super
> users, so I decided to write a wrapper function around, use a SECURITY
> DEFINER, and GRANT my user privilege to use the wrapper.
>
> BEGIN;
> CREATE
Hey all,
So the pg_cancel_backend() function by default is only available to super users, so I decided
to write a wrapper function around, use a SECURITY DEFINER, and GRANT my user privilege to use
the wrapper.
BEGIN;
CREATE FUNCTION kill_process(integer) RETURNS boolean AS 'select pg_cancel_