Re: BUG #5702: pg fails to use a conditional index even the where clause matches the condition

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Corin <info(at)netskin(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5702: pg fails to use a conditional index even the where clause matches the condition
Date: 2010-10-10 18:48:54
Message-ID: 1286736534.8516.63.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Newall 2010-10-10 22:42:30 rollback to savepoint leads to transaction already in progress
Previous Message maizi 2010-10-10 16:54:32 wrong timezone precision using plpythonu trigger