pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Raphael 'kena' Poss <knz@thaumogen.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15297: Irregular comparison rules for NULLs in tuples
Date: Thu, 26 Jul 2018 10:08:54 -0400
Message-ID: <94ffed23-67eb-3eac-e08e-5d4bf5287d8d@thaumogen.net> (raw)
In-Reply-To: <27390.1532613836@sss.pgh.pa.us>
References: <153261212701.1395.18260320763646237974@wrigleys.postgresql.org>
	<27390.1532613836@sss.pgh.pa.us>

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




view thread (4+ messages)  latest in thread

Message-ID: <94ffed23-67eb-3eac-e08e-5d4bf5287d8d@thaumogen.net>
Permalink:  ../94ffed23-67eb-3eac-e08e-5d4bf5287d8d@thaumogen.net/
Also on:    postgresql.org/message-id/94ffed23-67eb-3eac-e08e-5d4bf5287d8d@thaumogen.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: knz@thaumogen.net, tgl@sss.pgh.pa.us
  Subject: Re: BUG #15297: Irregular comparison rules for NULLs in tuples
  In-Reply-To: <94ffed23-67eb-3eac-e08e-5d4bf5287d8d@thaumogen.net>
  References: <153261212701.1395.18260320763646237974@wrigleys.postgresql.org> <27390.1532613836@sss.pgh.pa.us> <94ffed23-67eb-3eac-e08e-5d4bf5287d8d@thaumogen.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox