Re: [GENERAL] giving a user permission to kill their processes only

2014-07-21 Thread Jakub Jindra
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

Re: [GENERAL] giving a user permission to kill their processes only

2007-03-05 Thread Robert Treat
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

[GENERAL] giving a user permission to kill their processes only

2007-02-28 Thread George Nychis
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_