Mike Mascari wrote:

CREATE FUNCTION touch() RETURNS trigger AS '
begin
NEW.mod_date = LOCALTIMESTAMP;
return NEW;
end;
' language 'plpgsql';

CREATE TRIGGER t_foo
BEFORE INSERT OR UPDATE ON foo
FOR EACH ROW
EXECUTE PROCEDURE touch();

If you want timezone information, use TIMESTAMP WITH TIME ZONE and CURRENTTIMESTAMP. These are transaction start times.


Should read: CURRENT_TIMESTAMP

Mike Mascari



---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to