diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-11-10 22:11:39 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-11-10 22:11:39 -0500 |
commit | 0819778c43e3bc19364c541c3ea099b5c3b7d224 (patch) | |
tree | da45c2ecac85dd5c4c982cbeb4d29936f0bc9d3a | |
parent | 8d20eaa62b943bd155013aa01e0d6909bf520be0 (diff) | |
download | postgresql-0819778c43e3bc19364c541c3ea099b5c3b7d224.tar.gz postgresql-0819778c43e3bc19364c541c3ea099b5c3b7d224.zip |
Docs: fix misleading example.
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.
-rw-r--r-- | doc/src/sgml/datatype.sgml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index c47c7f4cb1b..6e7717dfb37 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -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 <type>character</type>. In collations where whitespace - is significant, this behavior can produce unexpected results, - e.g. <command>SELECT 'a '::CHAR(2) collate "C" < - 'a\n'::CHAR(2)</command> returns true. + is significant, this behavior can produce unexpected results; + for example <command>SELECT 'a '::CHAR(2) collate "C" < + E'a\n'::CHAR(2)</command> returns true, even though <literal>C</> + locale would consider a space to be greater than a newline. Trailing spaces are removed when converting a <type>character</type> value to one of the other string types. Note that trailing spaces <emphasis>are</> semantically significant in <type>character varying</type> and <type>text</type> values, and - when using pattern matching, e.g. <literal>LIKE</>, + when using pattern matching, that is <literal>LIKE</> and regular expressions. </para> |