Tom Lane wrote:
>
> Queries added by non-INSTEAD rules are always performed before the
> initially-given query, so you're right, the rule will see the unmodified
> value.
>
> I'd suggest folding the log-entry-making into your trigger, actually.
> If you have a trigger anyway then the insert into
Mark Volpe <[EMAIL PROTECTED]> writes:
> When I try this out, however, the rule seems to use the original
> value, rather than the "corrected" value.
Queries added by non-INSTEAD rules are always performed before the
initially-given query, so you're right, the rule will see the unmodified
value.
The actual trigger function I'm working with is over two screens long and
rather expensive to be calling twice! Perhaps I need to add another trigger
that updates the log table with the correct values after the fact. Recursive
triggers, fun! Thanks for the help,
Mark
Ang Chin Han wrote:
>
> Eit
On Wed, Aug 09, 2000 at 12:04:13PM -0400, Mark Volpe wrote:
> I have a table with a trigger that can potentially modify a row before it gets
> inserted or updated:
[snip]
> I have another table that tracks changes in the first table with rules:
AFAIK, rules get rewritten first, before triggers
Hi again,
I have a table with a trigger that can potentially modify a row before it gets
inserted or updated:
CREATE TABLE t1 (a int);
CREATE FUNCTION t1_validate() RETURNS opaque AS
'
BEGIN
IF (NEW.a>10) THEN NEW.a=10; END IF;