Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 27CBA4773CD for ; Wed, 15 Jan 2003 16:19:13 -0500 (EST) Received: from wolff.to (wolff.to [66.93.249.74]) by postgresql.org (Postfix) with SMTP id 752114773D7 for ; Wed, 15 Jan 2003 15:29:14 -0500 (EST) Received: (qmail 17200 invoked by uid 500); 15 Jan 2003 20:41:29 -0000 Date: Wed, 15 Jan 2003 14:41:29 -0600 From: Bruno Wolff III To: dev@archonet.com Cc: pgsql-sql@postgresql.org Subject: Re: RFC: A brief guide to nulls Message-ID: <20030115204129.GA16969@wolff.to> Mail-Followup-To: dev@archonet.com, pgsql-sql@postgresql.org References: <1522.192.168.1.16.1042651389.squirrel@mainbox.archonet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522.192.168.1.16.1042651389.squirrel@mainbox.archonet.com> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/238 X-Sequence-Number: 11103 On Wed, Jan 15, 2003 at 17:23:09 -0000, dev@archonet.com wrote: > > How do nulls work? > ================== > There is one very important rule when dealing with nulls. The result of > any operation or comparison, when applied to a null is null. The only > exception is testing if a value is null. I suggest rephrasing this to make it clear you need to use is null to do this and that = null won't do what you expect. > If you try to perform an operation on nulls, again the result is always > null. So the results of all of the following are null: The above isn't true (i.e. null op something isn't ALWAYS null). For example: bruno=> select 't'::boolean or null; ?column? ---------- t (1 row)