Skip to content

Commit 730fba4

Browse files
committed
Tidy up boolean data type page
by Thom Brown
1 parent 3d903da commit 730fba4

File tree

1 file changed

+30
-13
lines changed

1 file changed

+30
-13
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.250 2010/07/03 04:03:06 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.250.2.1 2010/07/24 12:17:34 petere Exp $ -->
22

33
<chapter id="datatype">
44
<title>Data Types</title>
@@ -2751,13 +2751,34 @@ P <optional> <replaceable>years</>-<replaceable>months</>-<replaceable>days</> <
27512751

27522752
<para>
27532753
<productname>PostgreSQL</productname> provides the
2754-
standard <acronym>SQL</acronym> type <type>boolean</type>.
2755-
<type>boolean</type> can have one of only two states:
2754+
standard <acronym>SQL</acronym> type <type>boolean</type>;
2755+
see <xref linkend="datatype-boolean-table">.
2756+
The <type>boolean</type> type can have one of only two states:
27562757
<quote>true</quote> or <quote>false</quote>. A third state,
27572758
<quote>unknown</quote>, is represented by the
27582759
<acronym>SQL</acronym> null value.
27592760
</para>
27602761

2762+
<table id="datatype-boolean-table">
2763+
<title>Boolean Data Type</title>
2764+
<tgroup cols="3">
2765+
<thead>
2766+
<row>
2767+
<entry>Name</entry>
2768+
<entry>Storage Size</entry>
2769+
<entry>Description</entry>
2770+
</row>
2771+
</thead>
2772+
<tbody>
2773+
<row>
2774+
<entry><type>boolean</type></entry>
2775+
<entry>1 byte</entry>
2776+
<entry>state of true of false</entry>
2777+
</row>
2778+
</tbody>
2779+
</tgroup>
2780+
</table>
2781+
27612782
<para>
27622783
Valid literal values for the <quote>true</quote> state are:
27632784
<simplelist>
@@ -2786,6 +2807,12 @@ P <optional> <replaceable>years</>-<replaceable>months</>-<replaceable>days</> <
27862807
(<acronym>SQL</acronym>-compliant) usage.
27872808
</para>
27882809

2810+
<para>
2811+
<xref linkend="datatype-boolean-example"> shows that
2812+
<type>boolean</type> values are output using the letters
2813+
<literal>t</literal> and <literal>f</literal>.
2814+
</para>
2815+
27892816
<example id="datatype-boolean-example">
27902817
<title>Using the <type>boolean</type> type</title>
27912818

@@ -2805,16 +2832,6 @@ SELECT * FROM test1 WHERE a;
28052832
t | sic est
28062833
</programlisting>
28072834
</example>
2808-
2809-
<para>
2810-
<xref linkend="datatype-boolean-example"> shows that
2811-
<type>boolean</type> values are output using the letters
2812-
<literal>t</literal> and <literal>f</literal>.
2813-
</para>
2814-
2815-
<para>
2816-
<type>boolean</type> uses 1 byte of storage.
2817-
</para>
28182835
</sect1>
28192836

28202837
<sect1 id="datatype-enum">

0 commit comments

Comments
 (0)