Docs: fix misleading example.
authorTom Lane
Wed, 11 Nov 2015 03:11:39 +0000 (22:11 -0500)
committerTom Lane
Wed, 11 Nov 2015 03:11:39 +0000 (22:11 -0500)
Commit 8457d0beca731bf0 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.

doc/src/sgml/datatype.sgml

index c47c7f4cb1bcc66ee2585c9fa69aab11a9d1ccd3..6e7717dfb378024b6ea18b50544443ce460e91d4 100644 (file)
@@ -1075,14 +1075,15 @@ SELECT '52093.89'::money::numeric::float8;
     stored and displayed that way.  However, trailing spaces are treated as
     semantically insignificant and disregarded when comparing two values
     of type character.  In collations where whitespace
-    is significant, this behavior can produce unexpected results,
-    e.g. SELECT 'a '::CHAR(2) collate "C" <
-    'a\n'::CHAR(2) returns true.
+    is significant, this behavior can produce unexpected results;
+    for example SELECT 'a '::CHAR(2) collate "C" <
+    E'a\n'::CHAR(2) returns true, even though C
+    locale would consider a space to be greater than a newline.
     Trailing spaces are removed when converting a character value
     to one of the other string types.  Note that trailing spaces
     are semantically significant in
     character varying and text values, and
-    when using pattern matching, e.g. LIKE,
+    when using pattern matching, that is LIKE and
     regular expressions.