Re: BUG #5702: pg fails to use a conditional index even the where clause matches the condition - Mailing list pgsql-bugs

From Jeff Davis
Subject Re: BUG #5702: pg fails to use a conditional index even the where clause matches the condition
Date
Msg-id 1286736534.8516.63.camel@jdavis
Whole thread Raw
In response to BUG #5702: pg fails to use a conditional index even the where clause matches the condition  ("Corin" <info@netskin.com>)
Responses Re: BUG #5702: pg fails to use a conditional index even the where clause matches the condition
List pgsql-bugs
On Sat, 2010-10-09 at 23:28 +0000, Corin wrote:
> I'd consider this a bug as "NOT x IS NULL" is the same as "x IS NOT NULL".

That is false.

http://thoughts.j-davis.com/2009/08/02/what-is-the-deal-with-nulls/

"NOT x IS NULL is not the same as x IS NOT NULL — If x is ROW(1,NULL),
then the former will evaluate to TRUE, and the latter will evaluate to
FALSE. Enjoy."

=> select ROW(1, NULL) IS NOT NULL;
 ?column?
----------
 f
(1 row)

=> select NOT ROW(1, NULL) IS NULL;
 ?column?
----------
 t
(1 row)


Regards,
    Jeff Davis

pgsql-bugs by date:

Previous
From: Netskin | Corin Langosch
Date:
Subject: Re: BUG #5702: pg fails to use a conditional index even the where clause matches the condition
Next
From: David Newall
Date:
Subject: rollback to savepoint leads to transaction already in progress