Обсуждение: functions and grants question

Поиск
Список
Период
Сортировка

functions and grants question

От
Avi Schwartz
Дата:
In other databases, stored procedures run under the privilege of the
stored procedure owner.  Is it supposed to work the same in postgresql?

I am the owner of the database, tables and functions.  When I grant
execute permission on a function to another user, that user gets
permission denied errors on the tables the stored procedure is
accessing.  Any idea what I may be doing wrong?

Thanks,
Avi
--
Avi Schwartz
avi@CFFtechnologies.com


Re: functions and grants question

От
Tom Lane
Дата:
Avi Schwartz <avi@CFFtechnologies.com> writes:
> In other databases, stored procedures run under the privilege of the
> stored procedure owner.  Is it supposed to work the same in postgresql?

Only if you attach the SECURITY DEFINER option to the function.

            regards, tom lane