Re: Allowing update of column only from trigger

Поиск
Список
Период
Сортировка
Искать
От
Andrey V. Semyonov
Тема
Re: Allowing update of column only from trigger
Дата
Msg-id
41FBD9AF.8090802@mail.ru
Ответ на
Список
Дерево обсуждения
Allowing update of column only from trigger Shawn Harrison <harrison@tbc.net>
Re: Allowing update of column only from trigger Shawn Harrison <sah@tyndale.com>
Re: Allowing update of column only from trigger PFC <lists@boutiquenumerique.com>
Re: Allowing update of column only from trigger "Andrey V. Semyonov" <wilfre@mail.ru>
Re: Allowing update of column only from trigger Shawn Harrison <harrison@tbc.net>
Re: Allowing update of column only from trigger Shawn Harrison <harrison@tbc.net>
isn't it possible to restrict UPDATE by access rights based on the DB's 
user?

Create table with owner set to the administrator of the database (NOT 
PostgreSQL SERVER!!!) and grant only the needed rights (or none of them) 
to the user from which the usual processing of the database will be 
performed. Then, create a trigger function with SECURITY DEFINER set and 
own it by the owner of the database (or other user, who's granted to 
UPDATE the table). So, if no one else is granted UPDATE on the table, 
the only UPDATE-modifiers of the table will be the owner and the trigger 
function's owner (if differs from owner).

Best regards,
    Andrey V. Semyonov
В списке pgsql-general по дате отправления
От: Josh Berkus
Дата:
От: Ragnar Hafstað
Дата:
FAQ