Tom Lane wrote:
> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> > Bruce Momjian <bruce@momjian.us> wrote:
> >> A private email I received indicated that our documentation about
> >> ignoring trailing spaces in CHAR() comparisons was slightly
> >> inaccurate. I have update our docs to indicate it is only
> >> non-pattern comparisons that ignore spaces with CHAR(). Applied
> >> doc patch attached.
>
> > This language:
>
> > | disregarded when non-pattern comparing two values
>
> > seems quite awkward.
>
> I didn't like it either. I suggest reverting that part of the patch.
> The added text later on is sufficient.
OK, since you liked that idea too, I have applied an updated patch,
attached.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 22d4c4e..0bb6594 100644
*** a/doc/src/sgml/datatype.sgml
--- b/doc/src/sgml/datatype.sgml
*************** SELECT '52093.89'::money::numeric::float
*** 1014,1025 ****
with spaces to the specified width <replaceable>n</>, and are
stored and displayed that way. However, the padding spaces are
treated as semantically insignificant. Trailing spaces are
! disregarded when non-pattern comparing two values of type <type>character</type>,
and they will be 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 comparisons, e.g. <literal>LIKE</>,
regular expressions.
</para>
--- 1014,1025 ----
with spaces to the specified width <replaceable>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 <type>character</type>,
and they will be 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</>,
regular expressions.
</para>