Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7b6fb76

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 b05ae27 commit 7b6fb76

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
@@ -1100,14 +1100,15 @@ SELECT '52093.89'::money::numeric::float8;
11001100
stored and displayed that way. However, trailing spaces are treated as
11011101
semantically insignificant and disregarded when comparing two values
11021102
of type <type>character</type>. In collations where whitespace
1103-
is significant, this behavior can produce unexpected results,
1104-
e.g. <command>SELECT 'a '::CHAR(2) collate "C" &lt;
1105-
'a\n'::CHAR(2)</command> returns true.
1103+
is significant, this behavior can produce unexpected results;
1104+
for example <command>SELECT 'a '::CHAR(2) collate "C" &lt;
1105+
E'a\n'::CHAR(2)</command> returns true, even though <literal>C</>
1106+
locale would consider a space to be greater than a newline.
11061107
Trailing spaces are removed when converting a <type>character</type> value
11071108
to one of the other string types. Note that trailing spaces
11081109
<emphasis>are</> semantically significant in
11091110
<type>character varying</type> and <type>text</type> values, and
1110-
when using pattern matching, e.g. <literal>LIKE</>,
1111+
when using pattern matching, that is <literal>LIKE</> and
11111112
regular expressions.
11121113
</para>
11131114

0 commit comments

Comments
 (0)