Re: BUG #15297: Irregular comparison rules for NULLs in tuples - Mailing list pgsql-bugs

From Raphael 'kena' Poss
Subject Re: BUG #15297: Irregular comparison rules for NULLs in tuples
Date
Msg-id 94ffed23-67eb-3eac-e08e-5d4bf5287d8d@thaumogen.net
Whole thread Raw
In response to Re: BUG #15297: Irregular comparison rules for NULLs in tuples  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #15297: Irregular comparison rules for NULLs in tuples  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Op 26-07-18 om 10:03 schreef Tom Lane:
>> "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.

I'd really like this to be true (I like it, it's simple) but then how do
you explain that row(1, null) > row(1, 2) is NULL, and not true? both
sides are record values and they are not null, after all.

-- 
Raphael 'kena' Poss


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15297: Irregular comparison rules for NULLs in tuples
Next
From: Tom Lane
Date:
Subject: Re: BUG #15297: Irregular comparison rules for NULLs in tuples