pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Michael Pilling <Michael.Pilling@dsto.defence.gov.au>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6064: != NULL, <> NULL do not work
Date: Sun, 19 Jun 2011 17:00:32 +0800
Message-ID: <4DFDBAB0.1000708@postnewspapers.com.au> (raw)
In-Reply-To: <4DFB1C6F020000250003E7D4@gw.wicourts.gov>
References: <201106170739.p5H7dLOe043882@wwwmaster.postgresql.org>
	<4DFB1C6F020000250003E7D4@gw.wicourts.gov>

On 06/17/2011 10:20 PM, Kevin Grittner wrote:
> "Michael Pilling"<Michael.Pilling@dsto.defence.gov.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-EQUA...

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



view thread (4+ messages)

Message-ID: <4DFDBAB0.1000708@postnewspapers.com.au>
Permalink:  ../4DFDBAB0.1000708@postnewspapers.com.au/
Also on:    postgresql.org/message-id/4DFDBAB0.1000708@postnewspapers.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: craig@postnewspapers.com.au, Kevin.Grittner@wicourts.gov, Michael.Pilling@dsto.defence.gov.au
  Subject: Re: BUG #6064: != NULL, <> NULL do not work
  In-Reply-To: <4DFDBAB0.1000708@postnewspapers.com.au>
  References: <201106170739.p5H7dLOe043882@wwwmaster.postgresql.org> <4DFB1C6F020000250003E7D4@gw.wicourts.gov> <4DFDBAB0.1000708@postnewspapers.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox