Re: CHAR(n) always trims trailing spaces in 7.4 - Mailing list pgsql-sql

From Tom Lane
Subject Re: CHAR(n) always trims trailing spaces in 7.4
Date
Msg-id 8636.1077221181@sss.pgh.pa.us
Whole thread Raw
In response to Re: CHAR(n) always trims trailing spaces in 7.4  (elein <elein@varlena.com>)
List pgsql-sql
elein <elein@varlena.com> writes:
> Somewhere the space trimming occurs.

The cast from char(n) to text (or varchar) is what's doing the trimming
in 7.4.  I think you can mostly revert the change by changing that
pg_cast entry to specify no conversion function instead of rtrim().
However that would probably result in squirrely, non-spec behavior for
comparisons.

> If char(n) is properly defined to not trim spaces then
> there should be a separate cat for char(n).

Possibly, but I think that is considering the issue much too narrowly.
Concatenation is not the only textual operator.
        regards, tom lane


pgsql-sql by date:

Previous
From: "Jeremy Smith"
Date:
Subject: Re: DISTINCT ON troubles
Next
From: Richard Huxton
Date:
Subject: Re: Compiling pl/pgsql functions