Re: BUG #14363: CASE against a literal value produces correct against, same expression against a column null doesn't - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #14363: CASE against a literal value produces correct against, same expression against a column null doesn't
Date
Msg-id 11314.1476128063@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #14363: CASE against a literal value produces correct against, same expression against a column null doesn't  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-bugs
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2016-10-10 20:56 GMT+02:00 <hcate3@gmail.com>:
>> case decimal_9_1
>> when null then 0
>> when decimal_9_1  then 1 end),

> You cannot to compare NULL with NULL in Postgres.

More specifically, you can, but you get a NULL result.  "NULL = NULL"
yields NULL, not true.  This is per SQL standard.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Vitaly Burovoy
Date:
Subject: Re: BUG #14363: CASE against a literal value produces correct against, same expression against a column null doesn't
Next
From: Henry Cate
Date:
Subject: Re: BUG #14363: CASE against a literal value produces correct against, same expression against a column null doesn't