Re: User Permissions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: User Permissions
Дата
Msg-id 1617.1011313303@sss.pgh.pa.us
обсуждение исходный текст
Ответ на User Permissions  (Braum Meakes <braum@telus.net>)
Список pgsql-sql
Braum Meakes <braum@telus.net> writes:
> I have a function that I've written in plpgsql.  In it I lock a table 
> before selecting a value and, depending on the value, either update the 
> record selected or insert a new one.  It works perfectly when I run it as a 
> super-user or as the owner of the table.  However, as a standard user I am 
> unable to lock the table.

[ eyeballs code ]  LOCK ... IN ACCESS SHARE MODE (ie, read lock)
requires SELECT privileges; all stronger forms of LOCK require UPDATE
and/or DELETE privileges.  This seems to be undocumented :-(.  Am
fixing the LOCK reference page now.

Per subsequent discussion, it's not real clear that you need LOCK at
all ... but the docs need to explain the privilege rules, since they're
not exactly obvious.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: chester c young
Дата:
Сообщение: Re: User Permissions
Следующее
От: "Josh Berkus"
Дата:
Сообщение: UPDATE Query problem