Re: Touch row ? - Mailing list pgsql-general

From Mike Mascari
Subject Re: Touch row ?
Date
Msg-id 4010EC85.5030301@mascari.com
Whole thread Raw
In response to Re: Touch row ?  (Mike Mascari <mascarm@mascari.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Mike Mascari
Date:
Subject: Re: Touch row ?
Next
From:
Date:
Subject: Optimizing SQL: bind variables, prepared stms, histograms