From 7465ae06be4f1dbc90575d68d1ffc3351e1ca855 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 8 Mar 2011 11:03:02 -0500 Subject: [PATCH] Document that char() ignores spaces in non-pattern comparisons, not in pattern comparisons such as LIKE and regex. --- doc/src/sgml/datatype.sgml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index b8f6e238f0..22d4c4e33a 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1014,11 +1014,13 @@ SELECT '52093.89'::money::numeric::float8; with spaces to the specified width n, and are stored and displayed that way. However, the padding spaces are treated as semantically insignificant. Trailing spaces are - disregarded when comparing two values of type character, + disregarded when non-pattern comparing two values of type character, and they will be 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. + character varying and text values, and + when using pattern matching comparisons, e.g. LIKE, + regular expressions. -- GitLab