On Sun, Feb 4, 2018 at 3:41 AM, Simon Riggs <si...@2ndquadrant.com> wrote: >> It is not clear to me what is exactly your concern if we try to follow >> #2? To me, #2 seems like a natural choice. > > At first, but it gives an anomaly so is not a good choice. The patch > does behavior #5, it rechecks the conditions with the latest row. > > Otherwise > WHEN MATCHED AND a=0 THEN UPDATE SET b=0 > WHEN MATCHED AND a=1 THEN UPDATE SET b=1 > would result in (a=1, b=0) in case of concurrent updates, which the > user clearly doesn't want.
I am unable to understand this. What are you presuming the tuple was originally? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company