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
- [SQL] Date of creation and of change Andreas Tille
- Re: [SQL] Date of creation and of change hlefebvre
- [SQL] Re: Date of creation and of change Andreas Tille
- Re: [SQL] Re: Date of creation and of change hlefebvre
- [SQL] Re: Date of creation and of change Andreas Tille
- Re: [SQL] Re: Date of creation and of ... hlefebvre
- [SQL] Re: Date of creation and of ... Andreas Tille
- Re: [SQL] Re: Date of creation... hlefebvre
- [SQL] Re: Date of creation and... Tom Lane
- [SQL] Re: Date of creation and... Andreas Tille
- Re: [SQL] Re: Date of creation... hlefebvre
- Re: [SQL] Re: Date of creation... hlefebvre
- [SQL] Re: Date of creation and... Andreas Tille
- [SQL] Re: Date of creation and of change Andreas Tille
