> This is an odd result. Both sides of that where clause evaluate to
> null, so it is null=null, yet this is not evaluating to true
> because I'm getting no rows back.
This is expected behavior. NULL means "unknown", so you can not know
that they are equivalent. But it is *not* the same as "NULL=NULL",
> Just to confirm that null=null
> evaluates to true (double-checking my sanity):
> monitoring=# select null=null;
> (1 row)
> Ok, quite bizarre.
Yes, this is an explicit feature in our parser to help out poor MSAccess
souls who have a product which generates illegal SQL queries. We put in
a specific rule to convert "anything=NULL" to "anything IS NULL", which
*is* legal syntax.
Check the archives to discover that no one is very happy with this
feature, except folks trying to use ODBC via Access and some goofy forms
interface. Sorry that it has bit you, but basically you should not rely
on this hack at any time, and the behavior "expr=expr" returning false
when each expression evaluates to NULL conforms to SQL standards.
> Can someone smarter than me tell me what I am missing?
I may not be smarter, just "been there, done that"; hopefully you will
find the information useful anyway ;)
In response to
pgsql-general by date
|Next:||From: Vivek Khera||Date: 2001-10-26 15:52:39|
|Subject: Re: DBD::Pg|
|Previous:||From: Fran Fabrizio||Date: 2001-10-26 15:19:43|
|Subject: null != null ???|