Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id A0D7F7661B8 for ; Thu, 21 Jun 2012 15:24:07 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Shm33-0000z9-QP for pgsql-bugs@postgresql.org; Thu, 21 Jun 2012 18:24:07 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q5LINrHG029241; Thu, 21 Jun 2012 14:23:53 -0400 (EDT) From: Tom Lane To: "Kevin Grittner" cc: "Pavel Stehule" , pgsql-bugs@postgresql.org, "Rikard Pavelic" Subject: Re: BUG #6701: IS NOT NULL doesn't work on complex composites In-reply-to: <4FE316E602000025000488B1@gw.wicourts.gov> References: <2782.1340219454@sss.pgh.pa.us> <4FE267D7.9080202@zg.htnet.hr> <4FE2B6FC.5070301@zg.htnet.hr> <4FE2E9710200002500048881@gw.wicourts.gov> <26035.1340292130@sss.pgh.pa.us> <4FE316E602000025000488B1@gw.wicourts.gov> Comments: In-reply-to "Kevin Grittner" message dated "Thu, 21 Jun 2012 12:43:18 -0500" Date: Thu, 21 Jun 2012 14:23:52 -0400 Message-ID: <29240.1340303032@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/191 X-Sequence-Number: 33418 "Kevin Grittner" writes: > Tom Lane 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