In PostgreSQL 18, SELECT NULL IS DISTINCT FROM NULL, 1 IS DISTINCT FROM NULL; returns two values. Which pair is correct?
Explanation
IS DISTINCT FROM is a total comparison that never returns null: two nulls count as not distinct (false), and a null against a non-null counts as distinct (true). This is exactly the pair of cases that the plain <> operator answers with null.