From: Tom Lane <tgl@sss.pgh.pa.us>
To: Aasmund Midttun Godal <postgresql@aasmund.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Before/After Trigger User Switching
Date: Wed, 20 Aug 2003 16:12:27 -0400
Message-ID: <17711.1061410347@sss.pgh.pa.us> (raw)
In-Reply-To: <20030820171250.15333.qmail@one.kreator.com>
References: <20030820171250.15333.qmail@one.kreator.com>
"Aasmund Midttun Godal" <postgresql@aasmund.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, postgresql@aasmund.com
Subject: Re: Before/After Trigger User Switching
In-Reply-To: <17711.1061410347@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox