| From: | Richard Broersma <richard(dot)broersma(at)gmail(dot)com> |
|---|---|
| To: | "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com> |
| Cc: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: Data access and user id |
| Date: | 2009-11-21 16:24:47 |
| Message-ID: | 396486430911210824m79a52999s37fb773f75335581@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
On Sat, Nov 21, 2009 at 8:08 AM, Jean-Yves F. Barbier <12ukwn(at)gmail(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jean-Yves F. Barbier | 2009-11-21 23:14:34 | Re: Data access and user id |
| Previous Message | Jean-Yves F. Barbier | 2009-11-21 16:08:09 | Data access and user id |