Re: FW: "=" operator vs. "IS" - Mailing list pgsql-sql

From Michael Kleiser
Subject Re: FW: "=" operator vs. "IS"
Date
Msg-id 40E180E5.40608@webde-ag.de
Whole thread Raw
In response to Re: FW: "=" operator vs. "IS"  (Rich Hall <rhall@micropat.com>)
List pgsql-sql
NULL is handled like "unknow"

When you comparing something with an unknown value,
you are not able to say if they are equal or not.
So the result is also unknown.
The result NULL is correct.

If you whant to check if somethings is NULL
you have to use "(anything) IS NULL"



Rich Hall schrieb:
> My question is why is the form
> 
> "(anything) = NULL"
> 
> allowed?
> 
> Since
> 
> "(anything) = NULL" is always Null, this cannot be what the coder
> intended. 
> 
> This is much different when comparing two variables, where the coder may
> have to handle the cases where the variables are Null. Here the
> comparison is to a constant.
> 
> 
> 
> 
> Rick
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: FW: "=" operator vs. "IS"
Next
From: Alvaro Sanchez-Mariscal
Date:
Subject: Unrecognized node type