Re: Before/After Trigger User Switching

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Aasmund Midttun Godal" <postgresql(at)aasmund(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Before/After Trigger User Switching
Date: 2003-08-20 20:12:27
Message-ID: 17711.1061410347@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Aasmund Midttun Godal" <postgresql(at)aasmund(dot)com> writes:
> When an operation is done throug a SECURITY DEFINER style function and
> causes a trigger the current_user depends on whether it is executed BEFORE
> or AFTER. I currently run 7.3.2. I believe the BEFORE behavior is correct
> while the AFTER behavior is wrong. A bug? already fixed?

An AFTER trigger is not fired until the interactive statement is about
to complete --- ie, after the SECURITY DEFINER function has returned.
There has been previous discussion (inconclusive) about changing the
time of invocation of AFTER triggers, but given the current timing this
is the behavior I'd expect.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joe Conway 2003-08-20 20:19:53 Re: Table conversion query...
Previous Message Aasmund Midttun Godal 2003-08-20 19:34:15 Re: Before/After Trigger User Switching