Re: Can the username calling a function be made available within the function?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Adam Witney <awitney(at)sghms(dot)ac(dot)uk>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can the username calling a function be made available within the function?
Date: 2004-04-07 13:56:57
Message-ID: 20040407135657.GB13185@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 07, 2004 at 11:23:25 +0100,
Adam Witney <awitney(at)sghms(dot)ac(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Wes Palmer 2004-04-07 14:11:28 Re: Cursors and Transactions, why?
Previous Message Martijn van Oosterhout 2004-04-07 13:54:15 Re: Can we have time based triggers in Postgresql??