Procedure Security Definer
by Stephen Gillespiepublished on
The Security Definer function is useful if you need to allow a privileged function on an object to be performed by a user without granting then the role or privilege directly.
This is a nice article on the pitfalls of using "SECURITY DEFINER": "ABUSING SECURITY DEFINER FUNCTIONS"