Re: BUG #6701: IS NOT NULL doesn't work on complex composites - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6701: IS NOT NULL doesn't work on complex composites
Date
Msg-id 2782.1340219454@sss.pgh.pa.us
Whole thread Raw
In response to BUG #6701: IS NOT NULL doesn't work on complex composites  (rikard.pavelic@zg.htnet.hr)
Responses Re: BUG #6701: IS NOT NULL doesn't work on complex composites
List pgsql-bugs
rikard.pavelic@zg.htnet.hr writes:
> create type t AS (i int);
> create type complex as (t t, i int);
> create table bad(i int, c complex);

> insert into bad values(1, null);
> insert into bad values(1, ROW(null, 2));
> insert into bad values(1, ROW(ROW(1), 2));

> select * from bad;
> select * from bad where c is null;

> --This doesn't work as expected
> select * from bad where c is not null;

What do you consider to be "expected"?  Have you read the documentation
where it points out that IS NULL and IS NOT NULL are not inverses for
composite values?
http://www.postgresql.org/docs/9.1/static/functions-comparison.html

(I'm not that thrilled with this behavior either, but it is per SQL
standard AFAICT.)

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: BUG #6701: IS NOT NULL doesn't work on complex composites
Next
From: Rikard Pavelic
Date:
Subject: Re: BUG #6701: IS NOT NULL doesn't work on complex composites