Thread: functions and grants question

functions and grants question

From
Avi Schwartz
Date:
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

From
Tom Lane
Date:
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