pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-bugs@postgresql.org
Cc: Rikard Pavelic <rikard.pavelic@zg.htnet.hr>
Subject: Re: BUG #6701: IS NOT NULL doesn't work on complex composites
Date: Thu, 21 Jun 2012 14:23:52 -0400
Message-ID: <29240.1340303032@sss.pgh.pa.us> (raw)
In-Reply-To: <4FE316E602000025000488B1@gw.wicourts.gov>
References: <E1ShNDt-00005k-8t@wrigleys.postgresql.org>
	<2782.1340219454@sss.pgh.pa.us>
	<4FE267D7.9080202@zg.htnet.hr>
	<CAFj8pRC461r19_JJ8n=O4XZsTqhjnH+nHTY723C+_FuGoRYAGg@mail.gmail.com>
	<4FE2B6FC.5070301@zg.htnet.hr>
	<4FE2E9710200002500048881@gw.wicourts.gov>
	<26035.1340292130@sss.pgh.pa.us>
	<4FE316E602000025000488B1@gw.wicourts.gov>

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> It's not clear to me whether the SQL standard rules on what should
>> happen in this case, or whether we should listen to it if it does
>> say that these values are not distinct.  They certainly *look*
>> distinct.
 
> I do sympathize with the point of view that a row value about which
> absolutely no applicable facts are known is a lot like not knowing
> what row you have, but they do seem distinct when you look at the
> output.
 
>> (Oh, and dare I mention arrays of nulls?)
 
> Hey, look!  An elephant!

The reason I mentioned arrays is that it seems clear to me that nobody
sane would consider ARRAY[NULL,NULL]::int[] to be equivalent to
NULL::int[].  The former has got well-defined array dimensions, for one
thing, while the latter does not.  So I think the standard is not being
very bright by conflating a null container with a container full of
nulls in the ROW case.  I'm willing to hold my nose and do what they say
for the specific case of "foo IS NULL" and "foo IS NOT NULL"
expressions, but I'm not eager to let that confusion propagate anyplace
else.

			regards, tom lane



view thread (14+ messages)  latest in thread

Message-ID: <29240.1340303032@sss.pgh.pa.us>
Permalink:  ../29240.1340303032@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29240.1340303032@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, Kevin.Grittner@wicourts.gov, pavel.stehule@gmail.com, rikard.pavelic@zg.htnet.hr
  Subject: Re: BUG #6701: IS NOT NULL doesn't work on complex composites
  In-Reply-To: <29240.1340303032@sss.pgh.pa.us>
  References: <E1ShNDt-00005k-8t@wrigleys.postgresql.org> <2782.1340219454@sss.pgh.pa.us> <4FE267D7.9080202@zg.htnet.hr> <CAFj8pRC461r19_JJ8n=O4XZsTqhjnH+nHTY723C+_FuGoRYAGg@mail.gmail.com> <4FE2B6FC.5070301@zg.htnet.hr> <4FE2E9710200002500048881@gw.wicourts.gov> <26035.1340292130@sss.pgh.pa.us> <4FE316E602000025000488B1@gw.wicourts.gov> <29240.1340303032@sss.pgh.pa.us>

* 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