Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bthjJ-00079x-KR for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Oct 2016 21:03:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bthjJ-00045Q-2k for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Oct 2016 21:03:25 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bthjI-00044t-9p for pgsql-bugs@postgresql.org; Mon, 10 Oct 2016 21:03:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bthjF-0006pe-6s for pgsql-bugs@postgresql.org; Mon, 10 Oct 2016 21:03:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u9AJYNtp011315; Mon, 10 Oct 2016 15:34:23 -0400 From: Tom Lane To: Pavel Stehule cc: hcate3@gmail.com, "pgsql-bugs@postgresql.org" Subject: Re: BUG #14363: CASE against a literal value produces correct against, same expression against a column null doesn't In-reply-to: References: <20161010185622.1398.15066@wrigleys.postgresql.org> Comments: In-reply-to Pavel Stehule message dated "Mon, 10 Oct 2016 21:15:59 +0200" Date: Mon, 10 Oct 2016 15:34:23 -0400 Message-ID: <11314.1476128063@sss.pgh.pa.us> X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Pavel Stehule writes: > 2016-10-10 20:56 GMT+02:00 : >> 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs