Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 0D29F1337BF5 for ; Thu, 28 Apr 2011 22:21:09 -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 26647-04 for ; Fri, 29 Apr 2011 01:21:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mail.postgresql.org (Postfix) with ESMTP id 1CCE7133798E for ; Thu, 28 Apr 2011 22:21:00 -0300 (ADT) Received: by wwk4 with SMTP id 4so82727wwk.1 for ; Thu, 28 Apr 2011 18:21:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=rAL1LyQFtceVPus3pqVzPGOz3ZU42qcUMPjrR9tn4yY=; b=jneiWyWHZxlonk7LjqHNvxk1pRhRcSJTaganI0DJ7MvtafhW2i04YhpP1EyROR6Oyp 9pMntyMKENvzDlN/XRJDGCdRCLWm/VZwXaNghfGqBoXZPIDewTYtJuYQWKEuJbFmuDwt rN5RYkognZ1sypdEuN/Uo2ahKm5V3FNzsWYz8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=EP4IluDaO4tR4iuMRjlwRHjHq/8rRoVKJ4kxw36JLECkFy5MSwBxlz28ebCg0O0oCT fzp12On8vdZN8O/LeMg1/N2Zowp2OGrOHd74Q1LjWFL1Rqn4EzSih0DRO8qSX53kHThC GxONAAh/gB+P13vCCxycz0uoi+LV/o9rOgWFQ= Received: by 10.216.121.201 with SMTP id r51mr4239138weh.56.1304040059058; Thu, 28 Apr 2011 18:20:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.121.15 with HTTP; Thu, 28 Apr 2011 18:20:39 -0700 (PDT) In-Reply-To: <4DB7D7E3.6010403@douglastechnology.co.uk> References: <4DB7D7E3.6010403@douglastechnology.co.uk> From: Josh Kupershmidt Date: Thu, 28 Apr 2011 21:20:39 -0400 Message-ID: Subject: Re: boolean states To: Jack Douglas Cc: pgsql-docs@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201104/102 X-Sequence-Number: 6673 On Wed, Apr 27, 2011 at 4:46 AM, Jack Douglas wrote: > =A0 =A0 =A0 =A0The boolean type can have one of only two states: "true" o= r "false". > A third state, "unknown", is represented by the SQL null value. > > This sounds like an oxymoron to me. I'm not crazy about that paragraph's confusion between two and three states either, but.. > Perhaps that sentence should be changed > to: > > =A0 =A0 =A0 =A0The boolean type can have one of three states: "true" or "= false" and > "unknown". The third state, "unknown", is represented by the SQL null val= ue. > or: > > =A0 =A0 =A0 =A0The boolean type can have one of three states: "true" or "= false" and > null. The third state, null, represents the logical value "unknown". I don't think either of these suggested replacements are any better. First, a boolean column can be declared NOT NULL. Second, I don't like the idea of misleading people into thinking that NULL is on equal footing with the other values of a given datatype, particularly as your first alternative implies. I'd vote for just ripping out the: | A third state, "unknown", is represented by the SQL null value. sentence entirely. I see no reason why NULL should be talked about in particular on the page about boolean data types; there are many data types, any of which might be NULL. I almost think it would be worthwhile to have a section in the docs on the (counterintuitive) behaviors of NULL, such as this great post: -- or maybe just a link to that page. Josh