From b73ecebf05041ab8643d6a4808ab807fb44f00b0 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 30 Nov 2000 18:46:42 +0000 Subject: [PATCH] Remove obsolete claim that char(n) is more efficient than other text types. --- doc/FAQ | 14 ++++++-------- doc/src/FAQ/FAQ.html | 20 +++++++++----------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/doc/FAQ b/doc/FAQ index 403808f7bf..11a4783ab8 100644 --- a/doc/FAQ +++ b/doc/FAQ @@ -811,19 +811,17 @@ Type Internal Name Notes "char" char 1 character CHAR(#) bpchar blank padded to the specified fixed length VARCHAR(#) varchar size specifies maximum length, no padding -TEXT text length limited only by maximum row length -BYTEA bytea variable-length array of bytes +TEXT text no specific upper limit on length +BYTEA bytea variable-length byte array (null-safe) You will see the internal name when examining system catalogs and in some error messages. The last four types above are "varlena" types (i.e., the first four - bytes are the length, followed by the data). char(#) allocates the - maximum number of bytes no matter how much data is stored in the - field. text, varchar(#), and bytea all have variable length on the - disk, and because of this, there is a small performance penalty for - using them. Specifically, the penalty is for access to all columns - after the first column of this type. + bytes on disk are the length, followed by the data). Thus the actual + space used is slightly greater than the declared size. However, these + data types are also subject to compression or being stored out-of-line + by TOAST, so the space on disk might also be less than expected. 4.16.1) How do I create a serial/auto-incrementing field? diff --git a/doc/src/FAQ/FAQ.html b/doc/src/FAQ/FAQ.html index 585807e6ab..1123086be9 100644 --- a/doc/src/FAQ/FAQ.html +++ b/doc/src/FAQ/FAQ.html @@ -534,7 +534,7 @@ A report generator? An embedded query language interface?

We have a nice graphical user interface called pgaccess, which is shipped as part of the distribution. Pgaccess also has a report -generator. The Web page is http://www.flex.ro/pgaccess

We also include ecpg, which is an embedded SQL query language interface for @@ -996,20 +996,18 @@ Type Internal Name Notes "char" char 1 character CHAR(#) bpchar blank padded to the specified fixed length VARCHAR(#) varchar size specifies maximum length, no padding -TEXT text length limited only by maximum row length -BYTEA bytea variable-length array of bytes +TEXT text no specific upper limit on length +BYTEA bytea variable-length byte array (null-safe)

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

- -The last four types above are "varlena" types (i.e., the first four bytes -are the length, followed by the data). char(#) allocates the -maximum number of bytes no matter how much data is stored in the field. -text, varchar(#), and bytea all have variable length on the disk, -and because of this, there is a small performance penalty for using -them. Specifically, the penalty is for access to all columns after the -first column of this type.

+ +The last four types above are "varlena" types (i.e., the first four +bytes on disk are the length, followed by the data). Thus the actual +space used is slightly greater than the declared size. However, these +data types are also subject to compression or being stored out-of-line +by TOAST, so the space on disk might also be less than expected.

4.16.1) How do I create a