Re: BUG #6064: != NULL, <> NULL do not work

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: Michael Pilling <Michael(dot)Pilling(at)dsto(dot)defence(dot)gov(dot)au>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6064: != NULL, <> NULL do not work
Date: 2011-06-19 09:00:32
Message-ID: 4DFDBAB0.1000708@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 06/17/2011 10:20 PM, Kevin Grittner wrote:
> "Michael Pilling"<Michael(dot)Pilling(at)dsto(dot)defence(dot)gov(dot)au> wrote:
>
>> A reasonable programmer would expect != NULL,<> NULL and IS NOT
>> NULL to be synonyms.
>
> Only if that programmer was not aware of the SQL standard and had
> not worked much with a standard-conforming database.

Yep, and if they want to continue working that way, they can use the
flag intended for compatibility with Microsoft Access that makes NULL =
NULL result in 't' instead of NULL.

http://www.postgresql.org/docs/current/static/runtime-config-compatible.html#GUC-TRANSFORM-NULL-EQUALS

Note that this flag is very specifically limited to equality
comparisions using the '=' operator. It won't make NULL behave as a
value in any other way. For example, 1 > NULL will still return NULL.

--
Craig Ringer

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2011-06-19 16:51:25 Re: BUG #6068: automatic analyze runs endlessly
Previous Message Jeff Janes 2011-06-18 22:32:24 BUG #6068: automatic analyze runs endlessly