Skip to content

Commit 0819778

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 8d20eaa commit 0819778

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/src/sgml/datatype.sgml

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

0 commit comments

Comments
 (0)