Re: Data access and user id - Mailing list pgsql-novice

From Richard Broersma
Subject Re: Data access and user id
Date
Msg-id 396486430911210824m79a52999s37fb773f75335581@mail.gmail.com
Whole thread Raw
In response to Data access and user id  ("Jean-Yves F. Barbier" <12ukwn@gmail.com>)
Responses Re: Data access and user id  ("Jean-Yves F. Barbier" <12ukwn@gmail.com>)
Re: Data access and user id  ("Jean-Yves F. Barbier" <12ukwn@gmail.com>)
List pgsql-novice
On Sat, Nov 21, 2009 at 8:08 AM, Jean-Yves F. Barbier <12ukwn@gmail.com> wrote:

> My PB is I just can use triggers with SECURITY DEFINER to do that, thus
> I can't update the field 'user_mod' with user's id because triggers are
> always executed as their owner's id, not caller's id.

http://www.postgresql.org/docs/8.4/interactive/functions-info.html

Notice that there are different user operators to choose from.
current_user ( user ), session_user.  I believe that one of those will
give you what you want.


--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

pgsql-novice by date:

Previous
From: "Jean-Yves F. Barbier"
Date:
Subject: Data access and user id
Next
From: "Jean-Yves F. Barbier"
Date:
Subject: Re: Data access and user id