IS NULL seems to return false, even when parameter is NULL

From: Lucazeo <lucazeo(at)katamail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: IS NULL seems to return false, even when parameter is NULL
Date: 2008-10-18 18:38:43
Message-ID: 2411a015-e265-45e5-87b5-09ddbd2ae323@k30g2000hse.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a strange problem with the following condition in a SELECT:
AND (("TableData" = "inDate") OR ("inDate" IS NULL))

it works perfectly when the input date in the function (inDate) matchs
a date in the table, but it does not work when the parameter inDate is
NULL.
I recall the function with pgadmin writing NULL as paramater.
It seems that ("inDate" IS NULL) never returns true, even when the
parameter is null...
What's wrong?

Lucazeo

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-10-19 01:05:54 Re: IS NULL seems to return false, even when parameter is NULL
Previous Message Ivan Sergio Borgonovo 2008-10-18 16:31:34 parser: tokens in tsearch2