Re: Re: Does PostgreSQL support EXISTS? - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Re: Does PostgreSQL support EXISTS?
Date
Msg-id 200106131509.f5DF99V08176@candle.pha.pa.us
Whole thread Raw
In response to Re: Re: Does PostgreSQL support EXISTS?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re: Does PostgreSQL support EXISTS?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I thought NOT IN was the only one that was concerned about any NULL?
>
> No, they both are: in the presence of NULLs, IN can return TRUE or NULL,
> NOT IN can return FALSE or NULL.
>
> The reason the FAQ is always about NOT NULL is that WHERE treats NULL as
> FALSE, so the average newbie writing an IN doesn't even realize he's
> getting a NULL rather than a FALSE.  With NOT NULL, he can't ignore it.

Got it.  How does an IN subquery returning NULL behave differently from
one returning FALSE?  I can't think of a test that would be affected.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: 7.1.2 temporary file area
Next
From: Tom Lane
Date:
Subject: Re: Re: Does PostgreSQL support EXISTS?