Re: Rules aren't doing what I expect - Mailing list pgsql-sql

From Tom Lane
Subject Re: Rules aren't doing what I expect
Date
Msg-id 2085.966003030@sss.pgh.pa.us
Whole thread Raw
In response to Rules aren't doing what I expect  (Mark Volpe <volpe.mark@epamail.epa.gov>)
List pgsql-sql
Mark Volpe <volpe.mark@epamail.epa.gov> 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.

I'd suggest folding the log-entry-making into your trigger, actually.
If you have a trigger anyway then the insert into t1_log is only one
more line in that trigger procedure...
        regards, tom lane


pgsql-sql by date:

Previous
From: pgsql-sql@ruby.sartorelli.gen.nz (Mailing List Expander)
Date:
Subject: Problem with SQL query (eats swap)
Next
From: Tom Lane
Date:
Subject: Re: Problem with SQL query (eats swap)