Search Postgresql Archives

Re: upsert and update filtering

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

 



armand pirvu <armand.pirvu@xxxxxxxxx> wrote:
But what if in the conflict situation I want to performa the update ONLY if the record is different. The update seems to happen no matter what
In other words is there anyway I can filter the update to happen (based on the sample date) only for 112 since col2 is different ?

That's quite possible. An ON CONFLICT's UPDATE accepts a WHERE clause,
which can reference both existing and excluded tuples. That WHERE clause
can back out of the UPDATE based on whatever criteria you like.

--
Peter Geoghegan


--
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