Search Postgresql Archives

Re: pg_affected Change Request

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

 



On Thu, Feb 10, 2005 at 10:31:40AM -0700, Michael Fuhr wrote:
> 
> UPDATE tablename SET col1 = <col1value>, col2 = <col2value>, ...
> WHERE keycol = <keyvalue>
>   AND (col1 IS DISTINCT FROM <col1value> OR
>        col2 IS DISTINCT FROM <col2value> ...)

You could also do this with a trigger.  If all columns in the old
and new rows are identical, then the trigger would return NULL to
skip the update for that row.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

[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