Re: Touch row ? - Mailing list pgsql-general

From Eric Ridge
Subject Re: Touch row ?
Date
Msg-id FB6F1D8E-4EB2-11D8-8446-000A95BB5944@tcdi.com
Whole thread Raw
In response to Re: Touch row ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Touch row ?
Next
From: "Lee Harr"
Date:
Subject: Re: pl/pgsql docs 37.4.3. Row Types -- how do I use this function?