Re: rule-system revaluates the functionale expressions - Mailing list pgsql-bugs

From jan pfaler
Subject Re: rule-system revaluates the functionale expressions
Date
Msg-id 20050103211635.40397.qmail@web25101.mail.ukl.yahoo.com
Whole thread Raw
List pgsql-bugs
Thanks Tom,

Refering to your answer: The syntax "NEW.column" seems
to hint rather to "the new value" of column as opposed
to "the expression for the new value", c.f.
"OLD.column". The fact that the order of evaluation
changes underlines the inconsistency; the order of
evaluation would not matter in the former case.

Hence, perhaps a note could be added to the
documentation (did not yet find anything on it)? E.g.
in "34.3. Rules on INSERT, UPDATE, and DELETE" one
could add "Note that NEW.column may be re-evaluated at
a new reference. This causes expressions having
side-effects, notably nextval(), potentially to obtain
differing values at each reference."

Anyhow, postgres (community) deserves at least my
gratitude for its consistency and coherence in
realisation. Thanks you for a quick answer. I will
look into the trigers.

Regards, Jan

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: More SSL questions..
Next
From: "T.J."
Date:
Subject: Re: BUG #1369: RC3 Compilation fails on mingw