petereisentraut
Joined 10 years ago
Karma
220
Submissions
33
Member since
Aug 9
Peter Eisentraut
View on Hacker NewsJoined 10 years ago
I'm curious what the use case of this is?
Deferrable constraints are usually considered for foreign keys, since there you might have to juggle updates to multiple tables and might violate the constraint in the intermediate states. But that doesn't appear to apply in that way to CHECK constraints.
It's the most consistent with the equality behavior of null values elsewhere.
Personally, I think that the existing PostgreSQL behavior (NULLS DISTINCT) is the "right" one, and the other option was mainly intended for compatibility with other SQL implementations. But I'm glad that people are also finding other uses for it.