Re: Do update permissions require select permissions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Do update permissions require select permissions
Дата
Msg-id 1644.1070057618@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Do update permissions require select permissions  (christopher-piker@uiowa.edu (Chris Piker))
Список pgsql-sql
christopher-piker@uiowa.edu (Chris Piker) writes:
> Now as some other user one can do:
>    update data set stuff = 'other stuff';
> And it works okay.  But the following fails:
>    update data set stuff = 'yet other stuff' where id = 1;
> Why is this?  

Because the latter requires reading, not only writing, the table.

One way to look at it is that if we didn't restrict that, then a person
having only UPDATE rights could nonetheless extract information from the
table.  For example consider
update data set stuff = stuff where id = 42;

This allows the user to determine whether id 42 exists in the table
(by noting the returned UPDATE count).  If you had not given that user
SELECT rights, presumably you don't really want him to be able to find
that out.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: explicit joins wrong planning
Следующее
От: Tomasz Myrta
Дата:
Сообщение: Re: explicit joins wrong planning