On 06/02/2019 12:23, Andrew Gierth wrote: > Two values which are sql-equal but not identical, such as two strings in > a case-insensitive collation that differ only by case, are > distinguishable in some contexts but not others, so what context > actually applies to the quoted rule? > > I think the only reasonable interpretation is that it should use the > same kind of distinctness that is being used by the unique constraint > and the equality comparison that define whether the FK is satisfied.
By that logic, a command such as UPDATE t1 SET x = '0' WHERE x = '-0'; could be optimized away as a noop, because in that world there is no construct by which you can prove whether the update happened. I think that would not be satisfactory. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services