| From: | Christopher Browne <cbbrowne(at)acm(dot)org> | 
|---|---|
| To: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: why the need for is null? | 
| Date: | 2004-01-01 23:28:41 | 
| Message-ID: | m3llorp7ti.fsf@wolfe.cbbrowne.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
In an attempt to throw the authorities off his trail, bbn-pgsql(dot)general(at)clansoft(dot)dk (Baldur Norddahl) transmitted:
> How come "X=null" is not the same as "X is null"?
Because NULL is not really a "value" in SQL.  Nothing can ever be
equal to a NULL, and that includes another NULL.
In Some Pseudo-SQL Database Systems, NULL is treated as a sort of
"zero" value, which is contrary to the SQL standards.
I seem to recall that in Microsoft's port of Sybase SQL Server,
there's some syntactic sugar that "x = NULL" is treated as if it were
querying "x is NULL."  
It would presumably be _possible_ to modify PostgreSQL's query parser
to handle "x = NULL" similarly; feel free to submit a patch to that
end, if you consider it a vital change to make.
-- 
output = reverse("ac.notelrac.teneerf" "@" "454aa")
http://www.ntlug.org/~cbbrowne/oses.html
Rules  of the  Evil Overlord  #212. "I  will not  send  out battalions
composed wholly of robots or  skeletons against heroes who have qualms
about killing living beings.  <http://www.eviloverlord.com/>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2004-01-02 00:12:21 | Re: why the need for is null? | 
| Previous Message | Martijn van Oosterhout | 2004-01-01 23:13:10 | Re: why the need for is null? |