On Jan 24, 2004, at 3:58 PM, Tom Lane wrote:

True.  So if your goal is to force the timestamp column to be the
correct value even when the user tries to set it to something else,
you'd still have to use a trigger or rule.

Maybe the rule is that the computed value is always used, unless: UPDATE foo OVERRIDE DEFAULTS set d=yesterday();

*shrug*. At least with something like the above, the user makes his intention explicit. Perhaps if user doesn't specify OVERRIDE DEFAULTS, postgres outputs a warning:
WARNING: value for column 'd' ignored.
HINT: Use UPDATE ... OVERRIDE DEFAULTS to override ON UPDATE DEFAULT values


and of course, this would be handy too:
        UPDATE foo OVERRIDE DEFAULTS set d=DEFAULT;

eric


---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to