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-05-01 23:07:10 |
Message-ID: | BANLkTi=hfidffvLMYwpSHcnO3UdGDiNmvQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-docs |
On Fri, Apr 29, 2011 at 3:29 AM, Jack Douglas
<jack(at)douglastechnology(dot)co(dot)uk> wrote:
> NULL is not unique to boolean, but UNKNOWN is - it would surely be wrong to
> have no mention of it at all on this page. This is because the boolean type
> is the only one used to represent truth (or logical) values. One of the
> comments from the link you provided:
>
>> What’s even more interesting is that for BOOLEAN they invented the keyword
>> UNKNOWN and the 2003 standard states “The null value of the boolean data
>> type is equivalent to the Unknown truth value.” So for BOOLEAN (and only
>> BOOLEAN AFAICT) you’re supposed to say WHERE <boolean primary> IS [NOT]
>> UNKNOWN. And in the definition of “literal”, which is supposed to “Specify a
>> non-null value”, “boolean literal” is equated to TRUE, FALSE or UNKNOWN (but
>> the latter is equivalent to a “null value” a few pages later).
Ah, OK - I had forgotten about that SQL syntax. I do agree that this sentence:
| A third state, "unknown", is represented by the SQL null value.
is particularly confusing, suggesting that "unknown" is a valid
boolean literal, on equal footing with "true" and "false".
We do document the use of IS [NOT] UNKNOWN already, see:
<http://www.postgresql.org/docs/current/interactive/functions-comparison.html>
and IMO that page is the appropriate place for such discussion. So
maybe we just need a link to that page, and should strip out the
confusing sentence about "third state" entirely? Patch attached.
Josh
Attachment | Content-Type | Size |
---|---|---|
boolean_unknown.patch | application/octet-stream | 954 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2011-05-02 16:00:48 | documentation bug - behave of NEW a OLD in plpgsql's triggers |
Previous Message | Greg Smith | 2011-04-30 03:46:28 | Documentation tweaks: ALTER USER, statement-based middleware |