Doug McNaught <doug@wireboard.com> writes:
>> Im want that on each insert, update to a table the column:
>> changed_on TIMESTAMP DEFAULT now()
>> will be set to now();
> An AFTER trigger to do this should be pretty easy.
It had better be a BEFORE trigger; AFTER is too late to affect the row
that will be stored. But I agree that this should be a very trivial
trigger to write. The body need be no more than
new.changed_on := now();
return new;
> Why don't you post
> what you've tried and we'll see where you went wrong?
regards, tom lane