Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4B97DB5DC0E for ; Sun, 19 Jun 2011 06:00:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 32284-08 for ; Sun, 19 Jun 2011 09:00:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [173.230.139.50]) by mail.postgresql.org (Postfix) with ESMTP id 48E01B5DC0D for ; Sun, 19 Jun 2011 06:00:48 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by www.postnewspapers.com.au (Postfix) with ESMTP id 30D2137; Sun, 19 Jun 2011 05:00:47 -0400 (EDT) X-Virus-Scanned: amavisd-new at postnewspapers.com.au.com Received: from www.postnewspapers.com.au ([127.0.0.1]) by localhost (www.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pBZwMULwzTCz; Sun, 19 Jun 2011 05:00:45 -0400 (EDT) Received: from mail.postnewspapers.com.au (ppp171-128.static.internode.on.net [150.101.171.128]) by www.postnewspapers.com.au (Postfix) with ESMTP id 9CFD12D; Sun, 19 Jun 2011 05:00:45 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id A568DAE2A8; Sun, 19 Jun 2011 17:00:44 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id F6LWdRt5QfHE; Sun, 19 Jun 2011 17:00:38 +0800 (WST) Received: from [10.1.1.5] (124-169-169-221.dyn.iinet.net.au [124.169.169.221]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 74C7FAE67A; Sun, 19 Jun 2011 17:00:38 +0800 (WST) Message-ID: <4DFDBAB0.1000708@postnewspapers.com.au> Date: Sun, 19 Jun 2011 17:00:32 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Thunderbird/3.1.10 MIME-Version: 1.0 To: Kevin Grittner CC: Michael Pilling , pgsql-bugs@postgresql.org Subject: Re: BUG #6064: != NULL, <> NULL do not work References: <201106170739.p5H7dLOe043882@wwwmaster.postgresql.org> <4DFB1C6F020000250003E7D4@gw.wicourts.gov> In-Reply-To: <4DFB1C6F020000250003E7D4@gw.wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/166 X-Sequence-Number: 30545 On 06/17/2011 10:20 PM, Kevin Grittner wrote: > "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. 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