summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-12-08 12:06:19 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2020-12-08 12:06:19 -0500
commitb4a5d5406594ddb2f8ca71912bb1837e9b5644d3 (patch)
tree4b36cf0ffa7723b345036b79857d935ddaecc024 /doc/src
parent5ba1df0f14d19a32c69adf97d452726fa6a28e02 (diff)
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/datatype.sgml13
1 files changed, 9 insertions, 4 deletions
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index f2dc2be50e8..45c4d282534 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -1131,6 +1131,14 @@ SELECT '52093.89'::money::numeric::float8;
</para>
<para>
+ 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 <xref linkend="multibyte">.
+ </para>
+
+ <para>
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
<type>character</type>. Longer strings have 4 bytes of overhead instead
@@ -1167,10 +1175,7 @@ SELECT '52093.89'::money::numeric::float8;
<para>
Refer to <xref linkend="sql-syntax-strings"> for information about
the syntax of string literals, and to <xref linkend="functions">
- 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 <xref linkend="multibyte">.
+ for information about available operators and functions.
</para>
<example>