Re: Comparisons on NULLs (was Re: A small problem...) - Mailing list pgsql-hackers

From darcy@druid.net (D'Arcy J.M. Cain)
Subject Re: Comparisons on NULLs (was Re: A small problem...)
Date
Msg-id m0zauEX-0000eRC@druid.net
Whole thread Raw
In response to Comparisons on NULLs (was Re: A small problem...)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Re: Comparisons on NULLs (was Re: A small problem...)  (The Hermit Hacker <scrappy@hub.org>)
Re: [HACKERS] Re: Comparisons on NULLs (was Re: A small problem...)  (dg@informix.com (David Gould))
List pgsql-hackers
Thus spake Tom Lane
> >> but I can see the reasonableness of defining "3 != NULL" as TRUE.
> 
> > Actually I see it as FALSE.  That's what I was suggesting earlier.  All
> > comparisons to null should be false no matter what the sense of the
> > test.
> 
> Hmm.  That yields extremely unintuitive results for = and !=.  That is,
> 
>     SELECT * FROM t WHERE b = NULL;
> 
> will never return any rows, even if there are some where b is null;

Hmmm.  That would be a problem.  Of course, we could treat the null
value at the higher level too.  I guess that's why we have the "IS
NULL" syntax in the first place.  It is different than comparing the
actual values.

Marc, how long can we hold 6.4 while we work this all out?

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: A James Lewis
Date:
Subject: Re: [HACKERS] Warning!!
Next
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] Re: Comparisons on NULLs (was Re: A small problem...)