1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.56 2001/06/18 19:05:11 tgl Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.57 2001/08/07 22:41:49 petere Exp $
3
3
-->
4
4
5
5
<chapter id="datatype">
@@ -552,28 +552,24 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
552
552
553
553
<table tocentry="1">
554
554
<title>Character Types</title>
555
- <tgroup cols="3 ">
555
+ <tgroup cols="2 ">
556
556
<thead>
557
557
<row>
558
- <entry>Type Name</entry>
559
- <entry>Storage</entry>
558
+ <entry>Type name</entry>
560
559
<entry>Description</entry>
561
560
</row>
562
561
</thead>
563
562
<tbody>
564
563
<row>
565
- <entry>character(n), char(n)</entry>
566
- <entry>(4+n) bytes</entry>
564
+ <entry>character(<replaceable>n</>), char(<replaceable>n</>)</entry>
567
565
<entry>Fixed-length blank padded</entry>
568
566
</row>
569
567
<row>
570
- <entry>character varying(n), varchar(n)</entry>
571
- <entry>(4+n) bytes</entry>
568
+ <entry>character varying(<replaceable>n</>), varchar(<replaceable>n</>)</entry>
572
569
<entry>Variable-length with limit</entry>
573
570
</row>
574
571
<row>
575
572
<entry>text</entry>
576
- <entry>(4+n) bytes</entry>
577
573
<entry>Variable unlimited length</entry>
578
574
</row>
579
575
</tbody>
@@ -624,9 +620,15 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
624
620
</para>
625
621
626
622
<para>
627
- Refer to <xref linkend="sql-syntax-strings"> for information about
628
- the syntax of string literals, and to <xref linkend="functions">
629
- for information about available operators and functions.
623
+ The storage requirement for data of these types is 4 bytes plus
624
+ the actual string, and in case of <type>character</type> plus the
625
+ padding. Long strings will actually be compressed by the system
626
+ automatically. In any case, the longest possible character string
627
+ that can be stored is about 1 GB. (The maximum value that will be
628
+ allowed for <replaceable>n</> in the data type declaration is
629
+ actually larger than that. It wouldn't be very useful to change
630
+ this because with multi-byte character encodings the number of
631
+ characters and bytes can be quite different anyway.)
630
632
</para>
631
633
632
634
<tip>
@@ -637,6 +639,12 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
637
639
</para>
638
640
</tip>
639
641
642
+ <para>
643
+ Refer to <xref linkend="sql-syntax-strings"> for information about
644
+ the syntax of string literals, and to <xref linkend="functions">
645
+ for information about available operators and functions.
646
+ </para>
647
+
640
648
<example>
641
649
<title>Using the character types</title>
642
650
0 commit comments