From: Tom Lane <tgl@sss.pgh.pa.us>
To: elein <elein@varlena.com>
Cc: scott.marlowe <scott.marlowe@ihs.com>
Cc: news.postgresql.org <jlim@natsoft.com.my>
Cc: pgsql-sql@postgresql.org
Subject: Re: CHAR(n) always trims trailing spaces in 7.4
Date: Thu, 19 Feb 2004 15:06:21 -0500
Message-ID: <8636.1077221181@sss.pgh.pa.us> (raw)
In-Reply-To: <20040219105505.S25537@cookie.varlena.com>
References: <18872.1077061249@sss.pgh.pa.us>
<Pine.LNX.4.33.0402171706530.31955-100000@css120.ihs.com>
<20040217162713.H25537@cookie.varlena.com>
<20170.1077076397@sss.pgh.pa.us>
<20040218120547.J25537@cookie.varlena.com>
<28866.1077166717@sss.pgh.pa.us>
<20040219105505.S25537@cookie.varlena.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, elein@varlena.com, scott.marlowe@ihs.com, jlim@natsoft.com.my
Subject: Re: CHAR(n) always trims trailing spaces in 7.4
In-Reply-To: <8636.1077221181@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox