| От | George Nychis |
|---|---|
| Тема | giving a user permission to kill their processes only |
| Дата | |
| Msg-id | 45E5E3CE.5000909@cmu.edu обсуждение исходный текст |
| Ответы |
Re: giving a user permission to kill their processes only
|
| Список | pgsql-general |
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_backend($1);' LANGUAGE SQL SECURITY DEFINER; REVOKE EXECUTE ON FUNCTION kill_process(integer) FROM PUBLIC; COMMIT; GRANT EXECUTE ON FUNCTION kill_process(integer) TO gnychis; The problem with this is I can now kill other users postgresql processes. I was wondering if anyone knows a way in which i can check that the postgres process being killed is running a query for that user? Therefore, they can't kill queries in postgres processes started by other users. Thanks! George
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера