Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id F1C99B5DBCE for ; Fri, 17 Jun 2011 11:20:57 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 67723-05 for ; Fri, 17 Jun 2011 14:20:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 54BE8B5DBD9 for ; Fri, 17 Jun 2011 11:20:51 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Fri, 17 Jun 2011 09:20:49 -0500 Message-Id: <4DFB1C6F020000250003E7D4@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Fri, 17 Jun 2011 09:20:47 -0500 From: "Kevin Grittner" To: "Michael Pilling" , Subject: Re: BUG #6064: != NULL, <> NULL do not work References: <201106170739.p5H7dLOe043882@wwwmaster.postgresql.org> In-Reply-To: <201106170739.p5H7dLOe043882@wwwmaster.postgresql.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/146 X-Sequence-Number: 30525 "Michael Pilling" 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