Re: Re: Does PostgreSQL support EXISTS?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Re: Does PostgreSQL support EXISTS?
Дата
Msg-id 200106131509.f5DF99V08176@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Re: Does PostgreSQL support EXISTS?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Re: Does PostgreSQL support EXISTS?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: 7.1.2 temporary file area
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: Does PostgreSQL support EXISTS?