Skip to content

Commit e29c16d

Browse files
committed
some clarifications inspired by the DocNotes
1 parent 2cb95cd commit e29c16d

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
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 $
33
-->
44

55
<chapter id="datatype">
@@ -552,28 +552,24 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
552552

553553
<table tocentry="1">
554554
<title>Character Types</title>
555-
<tgroup cols="3">
555+
<tgroup cols="2">
556556
<thead>
557557
<row>
558-
<entry>Type Name</entry>
559-
<entry>Storage</entry>
558+
<entry>Type name</entry>
560559
<entry>Description</entry>
561560
</row>
562561
</thead>
563562
<tbody>
564563
<row>
565-
<entry>character(n), char(n)</entry>
566-
<entry>(4+n) bytes</entry>
564+
<entry>character(<replaceable>n</>), char(<replaceable>n</>)</entry>
567565
<entry>Fixed-length blank padded</entry>
568566
</row>
569567
<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>
572569
<entry>Variable-length with limit</entry>
573570
</row>
574571
<row>
575572
<entry>text</entry>
576-
<entry>(4+n) bytes</entry>
577573
<entry>Variable unlimited length</entry>
578574
</row>
579575
</tbody>
@@ -624,9 +620,15 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
624620
</para>
625621

626622
<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.)
630632
</para>
631633

632634
<tip>
@@ -637,6 +639,12 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
637639
</para>
638640
</tip>
639641

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+
640648
<example>
641649
<title>Using the character types</title>
642650

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy