pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: rikard.pavelic@zg.htnet.hr
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6701: IS NOT NULL doesn't work on complex composites
Date: Wed, 20 Jun 2012 15:10:54 -0400
Message-ID: <2782.1340219454@sss.pgh.pa.us> (raw)
In-Reply-To: <E1ShNDt-00005k-8t@wrigleys.postgresql.org>
References: <E1ShNDt-00005k-8t@wrigleys.postgresql.org>

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



view thread (14+ messages)  latest in thread

Message-ID: <2782.1340219454@sss.pgh.pa.us>
Permalink:  ../2782.1340219454@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2782.1340219454@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rikard.pavelic@zg.htnet.hr
  Subject: Re: BUG #6701: IS NOT NULL doesn't work on complex composites
  In-Reply-To: <2782.1340219454@sss.pgh.pa.us>
  References: <E1ShNDt-00005k-8t@wrigleys.postgresql.org> <2782.1340219454@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox