Re: Trigger functions don't obey "strict" setting?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Trigger functions don't obey "strict" setting?
Date: 2000-09-08 22:22:30
Message-ID: 26538.968451750@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> I just read across the code in command/trigger.c:ExecCallTriggerFunc() and
> apparently the trigger function is called unconditionally even if the
> "strict" flag is set. Perhaps this should be amended somewhere.

Since triggers take no parameters, I'm not sure this is wrong. But if
it is wrong, then the code at fault is ExecCallTriggerFunc, not
FunctionCallInvoke. FunctionCallInvoke is just for *invoking*, not
for deciding whether to invoke.

> Btw., FunctionCallInvoke() would look to be the most prominent place to
> hook in the "setuid" feature. For that purpose I'd make the macro an
> inline function instead.

Ugh. The performance cost would be excessive. Instead, when fmgr is
setting up to call a setuid function, have it insert an extra level of
function handler that does the save/setup/restore of current UID.
That way, the cost is zero when you're not using the feature (which is
nearly always).

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Mascari 2000-09-09 00:48:25 I remember why I suggested CREATE FUNCTION...AS NULL
Previous Message Ross J. Reedstrom 2000-09-08 18:56:46 Re: "setuid" functions, a solution to the RI privilege problem