Re: rule on update - Mailing list pgsql-general

From Tom Lane
Subject Re: rule on update
Date
Msg-id 24997.1012924208@sss.pgh.pa.us
Whole thread Raw
In response to rule on update  ("Gerhard Pfeiffer" <gp@bnbt.de>)
List pgsql-general
"Gerhard Pfeiffer" <gp@bnbt.de> writes:
> It shouldn't show me this error, because the update invoked by the rule
> doesn't fulfill the condition (new.ent_udate=old.ent_udate).

Rules are macros rewritten at planning time, not at execution time,
so you cannot escape the rewrite cycle with an execution-time condition.

You will probably have better luck doing what you want to do with
a trigger.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Getting fields in a table through a query?
Next
From: "Marc G. Fournier"
Date:
Subject: PostgreSQL v7.2 Final Release