mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Tidy up boolean data type page
by Thom Brown
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.250 2010/07/03 04:03:06 tgl Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.250.2.1 2010/07/24 12:17:34 petere Exp $ -->
|
||||||
|
|
||||||
<chapter id="datatype">
|
<chapter id="datatype">
|
||||||
<title>Data Types</title>
|
<title>Data Types</title>
|
||||||
@ -2751,13 +2751,34 @@ P <optional> <replaceable>years</>-<replaceable>months</>-<replaceable>days</> <
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<productname>PostgreSQL</productname> provides the
|
<productname>PostgreSQL</productname> provides the
|
||||||
standard <acronym>SQL</acronym> type <type>boolean</type>.
|
standard <acronym>SQL</acronym> type <type>boolean</type>;
|
||||||
<type>boolean</type> can have one of only two states:
|
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>true</quote> or <quote>false</quote>. A third state,
|
||||||
<quote>unknown</quote>, is represented by the
|
<quote>unknown</quote>, is represented by the
|
||||||
<acronym>SQL</acronym> null value.
|
<acronym>SQL</acronym> null value.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<table id="datatype-boolean-table">
|
||||||
|
<title>Boolean Data Type</title>
|
||||||
|
<tgroup cols="3">
|
||||||
|
<thead>
|
||||||
|
<row>
|
||||||
|
<entry>Name</entry>
|
||||||
|
<entry>Storage Size</entry>
|
||||||
|
<entry>Description</entry>
|
||||||
|
</row>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<row>
|
||||||
|
<entry><type>boolean</type></entry>
|
||||||
|
<entry>1 byte</entry>
|
||||||
|
<entry>state of true of false</entry>
|
||||||
|
</row>
|
||||||
|
</tbody>
|
||||||
|
</tgroup>
|
||||||
|
</table>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Valid literal values for the <quote>true</quote> state are:
|
Valid literal values for the <quote>true</quote> state are:
|
||||||
<simplelist>
|
<simplelist>
|
||||||
@ -2786,6 +2807,12 @@ P <optional> <replaceable>years</>-<replaceable>months</>-<replaceable>days</> <
|
|||||||
(<acronym>SQL</acronym>-compliant) usage.
|
(<acronym>SQL</acronym>-compliant) usage.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
<xref linkend="datatype-boolean-example"> shows that
|
||||||
|
<type>boolean</type> values are output using the letters
|
||||||
|
<literal>t</literal> and <literal>f</literal>.
|
||||||
|
</para>
|
||||||
|
|
||||||
<example id="datatype-boolean-example">
|
<example id="datatype-boolean-example">
|
||||||
<title>Using the <type>boolean</type> type</title>
|
<title>Using the <type>boolean</type> type</title>
|
||||||
|
|
||||||
@ -2805,16 +2832,6 @@ SELECT * FROM test1 WHERE a;
|
|||||||
t | sic est
|
t | sic est
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
<para>
|
|
||||||
<xref linkend="datatype-boolean-example"> shows that
|
|
||||||
<type>boolean</type> values are output using the letters
|
|
||||||
<literal>t</literal> and <literal>f</literal>.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
<type>boolean</type> uses 1 byte of storage.
|
|
||||||
</para>
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<sect1 id="datatype-enum">
|
<sect1 id="datatype-enum">
|
||||||
|
Reference in New Issue
Block a user