Skip to content

Commit 10c6015

Browse files
committed
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
1 parent b88afd8 commit 10c6015

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,14 @@ SELECT '52093.89'::money::numeric::float8;
11301130
regular expressions.
11311131
</para>
11321132

1133+
<para>
1134+
The characters that can be stored in any of these data types are
1135+
determined by the database character set, which is selected when
1136+
the database is created. Regardless of the specific character set,
1137+
the character with code zero (sometimes called NUL) cannot be stored.
1138+
For more information refer to <xref linkend="multibyte"/>.
1139+
</para>
1140+
11331141
<para>
11341142
The storage requirement for a short string (up to 126 bytes) is 1 byte
11351143
plus the actual string, which includes the space padding in the case of
@@ -1167,10 +1175,7 @@ SELECT '52093.89'::money::numeric::float8;
11671175
<para>
11681176
Refer to <xref linkend="sql-syntax-strings"/> for information about
11691177
the syntax of string literals, and to <xref linkend="functions"/>
1170-
for information about available operators and functions. The
1171-
database character set determines the character set used to store
1172-
textual values; for more information on character set support,
1173-
refer to <xref linkend="multibyte"/>.
1178+
for information about available operators and functions.
11741179
</para>
11751180

11761181
<example>

0 commit comments

Comments
 (0)