Invoking user of the function with SECURITY DEFINER

From: Madan Kumar <madankumar1993(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Invoking user of the function with SECURITY DEFINER
Date: 2018-11-22 11:24:06
Message-ID: CAMtsaPG8BJJFNwe1MK0fd=U8_J=YSGaEus9+gvswVO9BhVNwmA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

How to get the user who is invoking the function with SECURITY DEFINER?
When we define the function to be SECURITY DEFINER, it will execute in the
context of the user who created it. Let's say I've given execute permission
for this function to other users and wish to know who is executing it. Is
there a way to find that out?
I tried CURRENT_USER and SESSION_USER but they return the function owner
since they execute in that context. So is there any way to figure out the
user who is invoking the function?

Warm Regards,
Madan Kumar K <https://about.me/madankumark>

*"There is no Elevator to Success. You have to take the Stairs"*

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2018-11-22 11:45:34 Re: Invoking user of the function with SECURITY DEFINER
Previous Message ramsiddu007 2018-11-22 09:10:19 Re: Empty Range Bound Specified for Partition