Re: Can the username calling a function be made available within the function? - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Can the username calling a function be made available within the function?
Date
Msg-id 20040407135657.GB13185@wolff.to
Whole thread Raw
In response to Can the username calling a function be made available within the function?  (Adam Witney <awitney@sghms.ac.uk>)
List pgsql-general
On Wed, Apr 07, 2004 at 11:23:25 +0100,
  Adam Witney <awitney@sghms.ac.uk> wrote:
>
> I'd like to be able to have a PL/pgSQL function defined as SECURITY DEFINER,
> but still have access to the calling username within the function. Is this
> possible?
>
> I could pass current_user as a parameter, but of course this could easily be
> bypassed.
>
> Is there a way of coding this?

You probably want session_user.

pgsql-general by date:

Previous
From: Mike Nolan
Date:
Subject: Re: Can we have time based triggers in Postgresql??
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Can we have time based triggers in Postgresql??