Re: trigger on table - Mailing list pgsql-sql

From Christopher Kings-Lynne
Subject Re: trigger on table
Date
Msg-id GNELIHDDFBOCMGBFGEFOCEGJCBAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Re: trigger on table  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-sql
> > I have tried the following: -
> >
> > CREATE FUNCTION set_item_last_updated () RETURNS OPAQUE AS '
> > BEGIN
> > UPDATE item SET last_updated = now();
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > RETURN OLD;
> > END;' LANGUAGE 'plpgsql';

Even better I guess, if you are running 7.1 or greater, use
CURRENT_TIMESTAMP instead of now()?

Chris



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Index not being used
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Index not being used