Skip site navigation (1) Skip section navigation (2)

Re: FW: "=" operator vs. "IS"

From: Michael Kleiser <mkl(at)webde-ag(dot)de>
To: Rich Hall <rhall(at)micropat(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: FW: "=" operator vs. "IS"
Date: 2004-06-29 14:47:01
Message-ID: 40E180E5.40608@webde-ag.de (view raw or flat)
Thread:
Lists: 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


In response to

pgsql-sql by date

Next:From: Tom LaneDate: 2004-06-29 14:57:45
Subject: Re: FW: "=" operator vs. "IS"
Previous:From: Rich HallDate: 2004-06-29 14:28:17
Subject: Re: FW: "=" operator vs. "IS"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group