Re: trigger on table

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Karel Zak" <zakkr(at)zf(dot)jcu(dot)cz>, "Graham Vickrage" <graham(at)digitalplanit(dot)com>
Cc: "Postgres SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: trigger on table
Date: 2002-02-15 01:04:44
Message-ID: GNELIHDDFBOCMGBFGEFOCEGJCBAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-02-15 01:23:00 Re: Index not being used
Previous Message Tom Lane 2002-02-15 00:46:38 Re: Index not being used