Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b73eceb

Browse files
committed
Remove obsolete claim that char(n) is more efficient than other text types.
1 parent 1f5cc8c commit b73eceb

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

doc/FAQ

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -811,19 +811,17 @@ Type Internal Name Notes
811811
"char" char 1 character
812812
CHAR(#) bpchar blank padded to the specified fixed length
813813
VARCHAR(#) varchar size specifies maximum length, no padding
814-
TEXT text length limited only by maximum row length
815-
BYTEA bytea variable-length array of bytes
814+
TEXT text no specific upper limit on length
815+
BYTEA bytea variable-length byte array (null-safe)
816816

817817
You will see the internal name when examining system catalogs and in
818818
some error messages.
819819

820820
The last four types above are "varlena" types (i.e., the first four
821-
bytes are the length, followed by the data). char(#) allocates the
822-
maximum number of bytes no matter how much data is stored in the
823-
field. text, varchar(#), and bytea all have variable length on the
824-
disk, and because of this, there is a small performance penalty for
825-
using them. Specifically, the penalty is for access to all columns
826-
after the first column of this type.
821+
bytes on disk are the length, followed by the data). Thus the actual
822+
space used is slightly greater than the declared size. However, these
823+
data types are also subject to compression or being stored out-of-line
824+
by TOAST, so the space on disk might also be less than expected.
827825

828826
4.16.1) How do I create a serial/auto-incrementing field?
829827

doc/src/FAQ/FAQ.html

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ <H4><A NAME="2.3">2.3</A>) Does PostgreSQL have a graphical user interface?
534534

535535
We have a nice graphical user interface called <I>pgaccess,</I> which is
536536
shipped as part of the distribution. <I>Pgaccess</I> also has a report
537-
generator. The Web page is <A HREF=
537+
generator. The Web page is <A HREF=""
538538
"http://www.flex.ro/pgaccess">http://www.flex.ro/pgaccess</A><P>
539539

540540
We also include <I>ecpg,</I> which is an embedded SQL query language interface for
@@ -996,20 +996,18 @@ <H4><A NAME="4.15">4.15</A>) What is the difference between the
996996
"char" char 1 character
997997
CHAR(#) bpchar blank padded to the specified fixed length
998998
VARCHAR(#) varchar size specifies maximum length, no padding
999-
TEXT text length limited only by maximum row length
1000-
BYTEA bytea variable-length array of bytes
999+
TEXT text no specific upper limit on length
1000+
BYTEA bytea variable-length byte array (null-safe)
10011001
</PRE><P>
10021002

10031003
You will see the internal name when examining system catalogs
10041004
and in some error messages.<P>
1005-
1006-
The last four types above are "varlena" types (i.e., the first four bytes
1007-
are the length, followed by the data). <I>char(#)</I> allocates the
1008-
maximum number of bytes no matter how much data is stored in the field.
1009-
<I>text, varchar(#),</I> and <I>bytea</I> all have variable length on the disk,
1010-
and because of this, there is a small performance penalty for using
1011-
them. Specifically, the penalty is for access to all columns after the
1012-
first column of this type.<P>
1005+
1006+
The last four types above are "varlena" types (i.e., the first four
1007+
bytes on disk are the length, followed by the data). Thus the actual
1008+
space used is slightly greater than the declared size. However, these
1009+
data types are also subject to compression or being stored out-of-line
1010+
by TOAST, so the space on disk might also be less than expected.<P>
10131011

10141012

10151013
<H4><A NAME="4.16.1">4.16.1</A>) How do I create a

0 commit comments

Comments
 (0)