Can't use NULL in IN conditional?

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Can't use NULL in IN conditional?
Дата
Msg-id 200012110749.eBB7nJv04235@hub.org
обсуждение исходный текст
Ответы Re: Can't use NULL in IN conditional?
Список pgsql-bugs
Charles Tassell (ctassell@isn.net) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Can't use NULL in IN conditional?

Long Description
I don't know if this is a "feature" that comes alogn with NULL values, or somethign I'm doing wrong, but I can't seem
tosearch for the NULL value via a WHERE xx IN clause.  I've re-written the query to use OR and it works fine then, but
notwith the IN clause.  This is with Postgres 7.02 on a Linux system (PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled
bygcc egcs-2.91.66) 


Sample Code
CREATE TABLE product_types (
  type_id serial,
  code  text
)
INSERT INTO product_types (code) VALUES ('0A');
INSERT INTO product_types (code) VALUES (NULL);
-- This works
SELECT type_id, code FROM product_types WHERE code = '0A' OR code = NULL;
-- This doesn't
SELECT type_id, code FROM product_types WHERE code IN ('OA', NULL);



No file was uploaded with this report

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

Предыдущее
От: Stu Coates
Дата:
Сообщение: 7.1beta1 JDBC Nested cursor problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Can't use NULL in IN conditional?