Andreas Tille <[EMAIL PROTECTED]> writes:
>> NEW.ChangedAt := timestamp(''now'');

> This avoids the error message, but doesn't have any effect to the value
> of ChangedAt.  It just remains the same as CreatedAt :-(.

I think you are getting burnt by premature constant folding --- see
nearby discussion of how to define a column default that gives the
time of insertion.  You need to write this as
        NEW.ChangedAt := now();
to prevent the system from reducing timestamp('now') to a constant
when the function is first executed.

                        regards, tom lane

Reply via email to