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

From Tom Lane
Subject Re: Re: Does PostgreSQL support EXISTS?
Date
Msg-id 26422.992444558@sss.pgh.pa.us
Whole thread Raw
In response to Does PostgreSQL support EXISTS?  (Raymond Chui <raymond.chui@noaa.gov>)
Responses Re: Re: Does PostgreSQL support EXISTS?  (Bruce Momjian <pgman@candle.pha.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.

            regards, tom lane

pgsql-general by date:

Previous
From: "Keith G. Murphy"
Date:
Subject: Re: Text data type doesn't accept newlines?
Next
From: Alex Pilosov
Date:
Subject: Re: PLPGSQL: Using Transactions and locks