Peder Hultin wrote:
Can someone recommend a way to update a timestamp field on insert and update and not get caught in this trap, without referencing CURRENT TIMESTAMP in insert or update SQL? I suspect this might not be possible. Any creative thinking much appreciated. Below is the DDL and SQL I'm using.
I think a work-around is to limit the trigger to only fire on updates to all columns except the timestamp column. To do this you have to list all columns for which the update should cause the trigger to fire:
CREATE TRIGGER trig AFTER UPDATE OF column1, column2, ... ON tab ... I have not tried this myself, but hopefully it should prevent the recursion. -- Øystein
