Re: function privileges

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: function privileges
Дата
Msg-id 26964.1138984469@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: function privileges  (Murat Tasan <murat.tasan@cwru.edu>)
Список pgsql-novice
Murat Tasan <murat.tasan@cwru.edu> writes:
> Now, as the owner of the database, execute
> CREATE FUNCTION F(T.id%TYPE) RETURNS T.name%TYPE AS $$ SELECT name
> FROM T WHERE id = $1; $$ LANGUAGE SQL;

> Now login as user A and try:
> SELECT * FROM F(69);
> (and let 69 be some id in T).

> The execution fails, stating that user A doesn't have SELECT
> privileges on T.

Right, because the function is running with A's privileges.
If you want the function to run with its owner's privileges,
label it SECURITY DEFINER.

            regards, tom lane

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

Предыдущее
От: Murat Tasan
Дата:
Сообщение: Re: function privileges
Следующее
От: "Tjibbe Rijpma"
Дата:
Сообщение: maximum for database users?