News for hackers. Stuff that matters.
Re:Postgres 15 improves UNIQUE and NULL by zeroimpl on Monday July 11, 2022 @09:43AM (#32056024)
Your last statement would be better written as: Because NULL values are of unknown equality, they may or may not violate UNIQUE constraints.

The safest implementation would assume that they do violate the constraint, rather than the current behavior assuming they don’t.

In practice I don’t think I’ve ever added a unique index on a nullable column where null might imply unknown. I have used it in cases where null meant “none”.

There are no comments on this comment yet.