some clarifications inspired by the DocNotes
authorPeter Eisentraut
Tue, 7 Aug 2001 22:41:49 +0000 (22:41 +0000)
committerPeter Eisentraut
Tue, 7 Aug 2001 22:41:49 +0000 (22:41 +0000)
doc/src/sgml/datatype.sgml

index 3ca2d7f296b54937ba910bc60bf2146c78431a33..21fa569a0162fe1df56bd53e0bc61d93f2f1b4ad 100644 (file)
@@ -1,5 +1,5 @@
 
 
  
@@ -552,28 +552,24 @@ CREATE TABLE tablename (
 
     
      Character Types
-     3">
+     2">
       
        
-   Type Name
-   Storage
+   Type name
    Description
        
       
       
        
-   character(n), char(n)
-   (4+n) bytes
+   character(n), char(n)
    Fixed-length blank padded
        
        
-   character varying(n), varchar(n)
-   (4+n) bytes
+   character varying(n), varchar(n)
    Variable-length with limit
        
        
    text
-   (4+n) bytes
    Variable unlimited length
        
       
@@ -624,9 +620,15 @@ CREATE TABLE tablename (
    
 
    
-    Refer to  for information about
-    the syntax of string literals, and to 
-    for information about available operators and functions.
+    The storage requirement for data of these types is 4 bytes plus
+    the actual string, and in case of character plus the
+    padding.  Long strings will actually be compressed by the system
+    automatically.  In any case, the longest possible character string
+    that can be stored is about 1 GB.  (The maximum value that will be
+    allowed for n in the data type declaration is
+    actually larger than that.  It wouldn't be very useful to change
+    this because with multi-byte character encodings the number of
+    characters and bytes can be quite different anyway.)
    
 
    
@@ -637,6 +639,12 @@ CREATE TABLE tablename (
     
    
 
+   
+    Refer to  for information about
+    the syntax of string literals, and to 
+    for information about available operators and functions.
+   
+
    
     Using the character types