doc: improve bpchar and character type length details
authorBruce Momjian
Tue, 31 Oct 2023 14:13:11 +0000 (10:13 -0400)
committerBruce Momjian
Tue, 31 Oct 2023 14:13:11 +0000 (10:13 -0400)
Reported-by: Jeff Davis
Discussion: https://postgr.es/m/32a9b8357e8e29b04f395f92c53b64e015a4caf1[email protected]

Author: Jeff Davis, adjustments by me

Backpatch-through: 16

doc/src/sgml/datatype.sgml

index 5d237657059322594e4496c4bb0d48c8122e56af..5a6cfbd94d8ab3cbaac01dd0df7ec6faa8be92d8 100644 (file)
@@ -1174,7 +1174,11 @@ SELECT '52093.89'::money::numeric::float8;
        
        
         character(n)char(n)bpchar(n)
-        fixed-length, blank padded
+        fixed-length, blank-padded
+       
+       
+        bpchar
+        variable unlimited length, blank-trimmed
        
        
         text
@@ -1230,19 +1234,22 @@ SELECT '52093.89'::money::numeric::float8;
 
    
     The type name varchar is an alias for character
-    varying, while char and bpchar are
-    aliases for character.
-    The varchar and char aliases are defined in
-    the SQL standard, but bpchar is
-    PostgreSQL extension.
+    varying, while bpchar (with length specifier) and
+    char are aliases for character.  The
+    varchar and char aliases are defined in the
+    SQL standard;  bpchar is a
+    PostgreSQL extension.
    
 
    
     If specified, the length n must be greater
-    than zero and cannot exceed 10485760.
-    character without length specifier is equivalent to
-    character(1). If character varying is used
-    without length specifier, the type accepts strings of any size.
+    than zero and cannot exceed 10,485,760.  If character
+    varying (or varchar) is used without
+    length specifier, the type accepts strings of any length. If
+    bpchar lacks a length specifier, it also accepts strings
+    of any length, but trailing spaces are semantically insignificant.
+    If character (or char) lacks a specifier,
+    it is equivalent to character(1).