Can't use NULL in IN conditional? - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject Can't use NULL in IN conditional?
Date
Msg-id 200012110749.eBB7nJv04235@hub.org
Whole thread Raw
Responses Re: Can't use NULL in IN conditional?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Stu Coates
Date:
Subject: 7.1beta1 JDBC Nested cursor problem
Next
From: Tom Lane
Date:
Subject: Re: Can't use NULL in IN conditional?