Eric Ridge <ebr@tcdi.com> writes:
> On Jan 24, 2004, at 2:34 PM, Tom Lane wrote:
>> A different tack that might be interesting to think about is to invent
>> a notion of an "update default" for a column, analogous to the existing
>> "insert default".
> This thought ran through my head last night. Something like:
> CREATE TABLE foo (
> id int4 DEFAULT nextval('foo_seq'),
> d timestamp DEFAULT now() ON UPDATE now()
> );
> But it seems that if the user explicitly provided a value for 'd',
> you'd want to use that over the computed value.
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.
regards, tom lane