I think you want to use session_user instead

Adam


> Is there any way to get the name of the current user inside a PL/pgSQL
> function that is defined with security definer?
> 
> current_user gives the name of the user who created the function.
> 
> The reason I want this is that I intend to use functions to maintain
> security, like this:
> 
> userA has only select permission on myTable.
> 
> The only way userA can insert to myTable is by providing parameters
> for and executing myFunction.
> 
> myFunction was created by user postgres who does have insert
> permission on myTable. However the code inside myFunction needs to do
> different things, depending on who called it.
> 
> Is there any way of getting the user?
> 
> regards
> Richard
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to