Re: Bug #765: 'IS NULL' versus '= NULL'

From: Hubert depesz Lubaczewski <depesz(at)depesz(dot)pl>
To: bhuvansql(at)myrealbox(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #765: 'IS NULL' versus '= NULL'
Date: 2002-09-14 12:08:00
Message-ID: 20020914120800.GB32506@depesz.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Sep 14, 2002 at 04:43:15AM -0400, pgsql-bugs(at)postgresql(dot)org wrote:
> Eventhough my_table contain a record with id as null, the last 2 sqls
> are not resulting that record. Why? Maybe my understanding would be
> wrong on this behaviour, if so please kindly apologize and give some
> description on this difference, since i dont have answer in the
> documentation.

afaik: according to sql documentation (and implementations different
that postgresql), any comparison where one of values is null should
yield "null" as response. is means, that NULL = NULL gives you "null"
instead of "true", and if you want this kind of checks you have to use
"is null" operator.

postgresql used to process "NULL = NULL" as true, but it was changed to
conform with standard and typical implementations in ohter databases.

best regards

depesz

--
hubert depesz lubaczewski http://www.depesz.pl/
------------------------------------------------------------------------
Mój Boże, spraw abym milczał, dopóki się nie upewnię, że naprawdę mam
coś do powiedzenia. (c) 1998 depesz

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-09-14 13:02:32 Bug #766: version difference creates problem
Previous Message Vladimir Dozen 2002-09-14 08:43:42 performance degradation while doing repeatative updates