Re: BUG #2961: NULL values in subselects force NOT IN to false

Поиск
Список
Период
Сортировка
От Aaron Logue
Тема Re: BUG #2961: NULL values in subselects force NOT IN to false
Дата
Msg-id Pine.LNX.4.33.0702061413360.8111-100000@ns.cryogenius.com
обсуждение исходный текст
Ответ на Re: BUG #2961: NULL values in subselects force NOT IN to false  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-bugs
On Mon, 5 Feb 2007, Stephan Szabo wrote:
> On Fri, 2 Feb 2007, Aaron Logue wrote:
> > The following bug has been logged online:
> >
> > Bug reference:      2961
> > Logged by:          Aaron Logue
> > Email address:      gyro@cryogenius.com
> > PostgreSQL version: 8.2.1
> > Operating system:   Linux (various flavors)
> > Description:        NULL values in subselects force NOT IN to false
> > Details:
> >
> > SELECT X FROM (SELECT 42 AS X) AS FOO WHERE X NOT IN (7,NULL);
> >
> > returns 0 rows.  Shouldn't "X NOT IN (7,NULL)" be
> > true if X is neither 7 nor NULL?  Removing the NULL causes the row to be
> > returned.
>
> NOT IN with NULLs is defined by spec in a way that most people do not
> expect if they aren't thinking about three valued logic.
>
> x NOT IN RVC is effectively NOT(x = ANY RVC).
> ...

Shouldn't IS be used to compare x with a NULL rather than = ?

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Thomas"
Дата:
Сообщение: BUG #2973: Compile Error with MIPSpro compiler
Следующее
От: "Gary Chambers"
Дата:
Сообщение: Re: BUG #2962: 8.2.1 lo_creat Documentation incorrect?