Skip to content

Commit ff4adfd

Browse files
committed
Docs: fix misleading example.
Commit 8457d0b introduced an example which, while not incorrect, failed to exhibit the behavior it meant to describe, as a result of omitting an E'' prefix that needed to be there. Noticed and fixed by Peter Geoghegan. I (tgl) failed to resist the temptation to wordsmith nearby text a bit while at it.
1 parent 86f358c commit ff4adfd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/src/sgml/datatype.sgml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1073,14 +1073,15 @@ SELECT '52093.89'::money::numeric::float8;
10731073
stored and displayed that way. However, trailing spaces are treated as
10741074
semantically insignificant and disregarded when comparing two values
10751075
of type <type>character</type>. In collations where whitespace
1076-
is significant, this behavior can produce unexpected results,
1077-
e.g. <command>SELECT 'a '::CHAR(2) collate "C" &lt;
1078-
'a\n'::CHAR(2)</command> returns true.
1076+
is significant, this behavior can produce unexpected results;
1077+
for example <command>SELECT 'a '::CHAR(2) collate "C" &lt;
1078+
E'a\n'::CHAR(2)</command> returns true, even though <literal>C</>
1079+
locale would consider a space to be greater than a newline.
10791080
Trailing spaces are removed when converting a <type>character</type> value
10801081
to one of the other string types. Note that trailing spaces
10811082
<emphasis>are</> semantically significant in
10821083
<type>character varying</type> and <type>text</type> values, and
1083-
when using pattern matching, e.g. <literal>LIKE</>,
1084+
when using pattern matching, that is <literal>LIKE</> and
10841085
regular expressions.
10851086
</para>
10861087

0 commit comments

Comments
 (0)