Re: get username of user calling function?

From: "David Legault" <legault(dot)david(at)gmail(dot)com>
To: "George Nychis" <gnychis(at)cmu(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: get username of user calling function?
Date: 2007-03-01 17:47:01
Message-ID: e0b20d410703010947q76c4d2a6l9f286250dac141da@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3/1/07, George Nychis <gnychis(at)cmu(dot)edu> wrote:
>
>
>
> David Legault wrote:
> >
> >
> > See the EXECUTE function in the pl/pgSQL language in the docs for
> dynamic
> > queries.
> >
> So it turns out that in a SECURITY DEFINER the current_user is the owner
> of the function.
> I had to use session_user and it works now :)

yes because you are running it in the context of the owner of the function

there is also another SECURITY setting that will be in the context of the
caller where current_user() should return the callee.

- George
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Josh Berkus 2007-03-01 18:49:48 Re:
Previous Message Willy-Bas Loos 2007-03-01 17:42:27 Re: cast bytea to text