| От | Tom Lane |
|---|---|
| Тема | Re: Question on TRUNCATE privleges |
| Дата | |
| Msg-id | 28265.1109285264@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Question on TRUNCATE privleges ("Keith Worthington" <keithw@narrowpathinc.com>) |
| Список | pgsql-novice |
"Keith Worthington" <keithw@narrowpathinc.com> writes:
> On Thu, 24 Feb 2005 17:15:42 -0500, Tom Lane wrote
>> Yeah. I've dropped the idea personally -- the suggestion that the table
>> owner can provide a SECURITY DEFINER procedure to do the TRUNCATE if
>> he wants to allow others to do it seems to me to cover the problem.
> Could someone point me in the direction of documentation on this SECURITY
> DEFINER feature?
See CREATE FUNCTION. Something like (untested)
create function truncate_my_table() returns void as
$$ truncate my_table $$ language sql security definer;
You'd probably then revoke the default public EXECUTE rights on this
function, and grant EXECUTE only to selected users.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера