Thread: security definer function

security definer function

From
Tomek
Date:
Hi

I have two functions:

A) function defined with "SECURITY DEFINER"
B) function defined with "SECURITY INVOKER"

Function A calls function B.

How is the function b called - with rights of definer of function A, or 
rather with rights of caller of function A ?

Regards,
Tomasz Myrta



Re: security definer function

From
Peter Eisentraut
Date:
Tomek writes:

> A) function defined with "SECURITY DEFINER"
> B) function defined with "SECURITY INVOKER"
>
> Function A calls function B.
>
> How is the function b called - with rights of definer of function A,

Yes.

An easy way to arrive at this answer would have been to print current_user
in function B.

-- 
Peter Eisentraut   peter_e@gmx.net