Skip site navigation (1) Skip section navigation (2)

Re: boolean states

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Jack Douglas <jack(at)douglastechnology(dot)co(dot)uk>
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: boolean states
Date: 2011-04-29 01:20:39
Message-ID: BANLkTimyUsgA-DvFi+AweMB4XXogUaMhDA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-docs
On Wed, Apr 27, 2011 at 4:46 AM, Jack Douglas
<jack(at)douglastechnology(dot)co(dot)uk> wrote:
>        The boolean type can have one of only two states: "true" or "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:
>
>        The boolean type can have one of three states: "true" or "false" and
> "unknown". The third state, "unknown", is represented by the SQL null value.
> or:
>
>        The 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:
<http://thoughts.j-davis.com/2009/08/02/what-is-the-deal-with-nulls/>
-- or maybe just a link to that page.

Josh

In response to

Responses

pgsql-docs by date

Next:From: Jack DouglasDate: 2011-04-29 07:29:45
Subject: Re: boolean states
Previous:From: Heikki LinnakangasDate: 2011-04-28 09:59:14
Subject: Re: document about pg_ctl kill

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group