From: Tom Lane Date: Tue, 8 Dec 2020 17:06:19 +0000 (-0500) Subject: Doc: explain that the string types can't store \0 (ASCII NUL). X-Git-Tag: REL9_6_21~56 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=3410a9b57062609ecd823532847f622d862ba9ec;p=postgresql.git Doc: explain that the string types can't store \0 (ASCII NUL). This restriction was mentioned in connection with string literals, but it wasn't made clear that it's a general restriction not just a syntactic limitation in query strings. Per unsigned documentation comment. Discussion: https://postgr.es/m/160720552914.710.16625261471128631268@wrigleys.postgresql.org --- diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 22f5eed5c3d..fb9b95630e2 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1116,6 +1116,14 @@ SELECT '52093.89'::money::numeric::float8; regular expressions. + + The characters that can be stored in any of these data types are + determined by the database character set, which is selected when + the database is created. Regardless of the specific character set, + the character with code zero (sometimes called NUL) cannot be stored. + For more information refer to . + + The storage requirement for a short string (up to 126 bytes) is 1 byte plus the actual string, which includes the space padding in the case of @@ -1153,10 +1161,7 @@ SELECT '52093.89'::money::numeric::float8; Refer to for information about the syntax of string literals, and to - for information about available operators and functions. The - database character set determines the character set used to store - textual values; for more information on character set support, - refer to . + for information about available operators and functions.