Subject: Re: boolean states

From: "Kevin Grittner" <[email-masked]>
Date: Wed, 04 May 2011 07:26:29 -0500

Jack Douglas  wrote:
 
> There are two kinds of people on this earth, those who understand
> boolean arithmatic and those who don't. I'm not one of them.
 
Hmmm...  From that, I don't know if you do.  Which do I record in the
understands_boolean column of the database record for you?  Dang, I
knew I should have had *two* flags: known_to_understand_boolean and
known_to_not_understand_boolean.  That would have been much simpler
than allowing NULL for UNKNOWN....
 
-Kevin

"When you come to a fork in the road, take it."  -Yogi Berra

---

From: Bruce Momjian <[email-masked]>
Date: Mon, 9 May 2011 21:04:49 -0400 (EDT)

> than allowing NULL for UNKNOWN....

Attached patch applied to HEAD and 9.0.X.

-- 
  Bruce Momjian  <[email-masked]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
new file mode 100644
index 657835c..c1a34fb
*** a/doc/src/sgml/func.sgml
--- b/doc/src/sgml/func.sgml
***************
*** 82,89 ****
       <member><literal>NOT</></member>
      </simplelist>
  
!     <acronym>SQL</acronym> uses a three-valued Boolean logic where the null value represents
!     <quote>unknown</quote>.  Observe the following truth tables:
  
      <informaltable>
       <tgroup cols="4">
--- 82,90 ----
       <member><literal>NOT</></member>
      </simplelist>
  
!     <acronym>SQL</acronym> uses a three-valued logic system with true,
!     false, and <literal>null</>, which represents <quote>unknown</quote>.
!     Observe the following truth tables:
  
      <informaltable>
       <tgroup cols="4">

---

From: Josh Kupershmidt <[email-masked]>
Date: Mon, 9 May 2011 21:45:01 -0400

> Attached patch applied to HEAD and 9.0.X.

The patch you attached looks like it's a fix for the -bugs thread
about "inappropriate reference to boolean logic", not the complaint
raised in this thread.

Josh

---

From: Bruce Momjian <[email-masked]>
Date: Mon, 9 May 2011 23:24:00 -0400 (EDT)

> about "inappropriate reference to boolean logic", not the complaint

I see what you mean.  I have applied the attached doc patch to HEAD.

  + It's impossible for everything to be true. +
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
new file mode 100644
index bc1ec3f..ab8eb2d
*** a/doc/src/sgml/datatype.sgml
--- b/doc/src/sgml/datatype.sgml
*************** P <optional> <replaceable>years</>-<repl
*** 2784,2792 ****
      <productname>PostgreSQL</productname> provides the
      standard <acronym>SQL</acronym> type <type>boolean</type>;
      see <xref linkend="datatype-boolean-table">.
!     The <type>boolean</type> type can have one of only two states:
!     <quote>true</quote> or <quote>false</quote>.  A third state,
!     <quote>unknown</quote>, is represented by the
      <acronym>SQL</acronym> null value.
     </para>
  
--- 2784,2792 ----
      <productname>PostgreSQL</productname> provides the
      standard <acronym>SQL</acronym> type <type>boolean</type>;
      see <xref linkend="datatype-boolean-table">.
!     The <type>boolean</type> type can have several states:
!     <quote>true</quote>, <quote>false</quote>, and a third state,
!     <quote>unknown</quote>, which is represented by the
      <acronym>SQL</acronym> null value.
     </para>