I'm trying to find a way to update a timestamp field when a record is updated in postgresql automaticly, unless the timestamp field is specified in the query.
So far I've got this, but it doens't work:
CREATE RULE table_timestamp_rule AS ON INSERT TO table WHERE new.lastupdate is null DO UPDATE table set lastupdate = timestamp('now') WHERE table.oid = new.oid;
Any ideas?
Thanks
So far I've got this, but it doens't work:
CREATE RULE table_timestamp_rule AS ON INSERT TO table WHERE new.lastupdate is null DO UPDATE table set lastupdate = timestamp('now') WHERE table.oid = new.oid;
Any ideas?
Thanks