pg.ddx.io pgsql-bugs@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Michael Pilling <Michael.Pilling@dsto.defence.gov.au>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #6064: != NULL, <> NULL do not work
Date: Fri, 17 Jun 2011 09:20:47 -0500
Message-ID: <4DFB1C6F020000250003E7D4@gw.wicourts.gov> (raw)
In-Reply-To: <201106170739.p5H7dLOe043882@wwwmaster.postgresql.org>
References: <201106170739.p5H7dLOe043882@wwwmaster.postgresql.org>
"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.
NULL is conceptually intended to indicate "unknown" or "not
applicable". If you have a person table with a date_of_birth
column, which contains NULL for a number of rows for which the date
of birth is unknown, can you say that all such people have the same
date of birth? No; for any such person, the result of comparing
their date of birth to anyone else's (whether or not the other one
is NULL) is UNKNOWN.
You might want to read up on IS [NOT] DISTINCT FROM. In the SQL
language, while NULL is not known to be equal to NULL, you *can* say
that NULL IS NOT DISTINCT FROM NULL.
This is most definitely not a bug in the software. The
documentation does cover it here:
http://www.postgresql.org/docs/9.0/interactive/functions-comparison.html
Is there something you would add to that?
-Kevin
view thread (4+ messages) latest in thread
Message-ID: <4DFB1C6F020000250003E7D4@gw.wicourts.gov> Permalink: ../4DFB1C6F020000250003E7D4@gw.wicourts.gov/ Also on: postgresql.org/message-id/4DFB1C6F020000250003E7D4@gw.wicourts.gov ·
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: Kevin.Grittner@wicourts.gov, Michael.Pilling@dsto.defence.gov.au Subject: Re: BUG #6064: != NULL, <> NULL do not work In-Reply-To: <4DFB1C6F020000250003E7D4@gw.wicourts.gov> References: <201106170739.p5H7dLOe043882@wwwmaster.postgresql.org> <4DFB1C6F020000250003E7D4@gw.wicourts.gov> * 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