=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> The SQL standard mandates ternary logic for values that involve NULL, where
> NULL means "unknown".
Right.
> "select (1, (1, NULL::int)) > (1, (1, 2))" -> returns true !?
We insist on non-null record values being totally ordered, because without
that you can't build a working btree opclass for them. So the general
principle for comparing corresponding fields in two records is that nulls
sort after non-nulls and two nulls are treated as equal. The same goes
for elements in other container types such as arrays.
I don't know whether this behavior can be justified by chapter and verse
in the SQL standard, but it doesn't really matter; we will not change it.
regards, tom lane