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 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2004-06-29 14:57:45 | Re: FW: "=" operator vs. "IS" |
Previous Message | Rich Hall | 2004-06-29 14:28:17 | Re: FW: "=" operator vs. "IS" |