Search Postgresql Archives

Re: Empty Updates, ON UPDATE triggers and Rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 6 Aug 2009 13:15:57 -0400
Merlin Moncure <mmoncure@xxxxxxxxx> wrote:

> CREATE OR REPLACE FUNCTION set_last_modified ()
> RETURNS TRIGGER
> AS $$
> BEGIN
>   IF NEW != OLD THEN  -- 8.4 syntax
>     NEW.last_modified = NOW();
>   END IF;
> 
>   RETURN NEW;
> END;
> $$ LANGUAGE PLPGSQL;

Thanks - I'll try this.  Since using 8.3 sounds like I need to
replace above with:

IF old::text != new::text 

?

I'll give it a go anyway....

Josh

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux