> On Feb 22, 2023, at 9:18 AM, Jeff Davis <pgsql@j-davis.com> wrote:
>
> Another option is having some kind SECURITY NONE that would run the
> code as a very limited-privilege user that can basically only access
> the catalog. That would be useful for running default expressions and
> the like without the definer or invoker needing to be careful.
Another option is to execute under the intersection of their privileges, where both the definer and the invoker need
theprivileges in order for the action to succeed. That would be more permissive than the proposed SECURITY NONE, while
stillpreventing either party from hijacking privileges of the other.
—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company