From: elein <elein@varlena.com>
To: scott.marlowe <scott.marlowe@ihs.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: elein <elein@varlena.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: Tue, 17 Feb 2004 16:27:13 -0800
Message-ID: <20040217162713.H25537@cookie.varlena.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0402171706530.31955-100000@css120.ihs.com>
References: <18872.1077061249@sss.pgh.pa.us>
<Pine.LNX.4.33.0402171706530.31955-100000@css120.ihs.com>
Apparently the ::char is cast to varchar and then text?
That explains x || ' ' || x
On Tue, Feb 17, 2004 at 05:07:24PM -0700, scott.marlowe wrote:
> On Tue, 17 Feb 2004, Tom Lane wrote:
>
> > elein <elein@varlena.com> writes:
> > > This is an example of the problem. It used to expand
> > > the middle thing to 15.
> >
> > > elein=# select 'x' || ' '::char(15) || 'x';
> > > ?column?
> > > ----------
> > > xx
> > > (1 row)
> >
> > Still does, but then the spaces go away again when the value goes into
> > the concatenation, because concatenation is a text operator.
>
> But then this:
>
> select 'x'||' '||'x'
>
> should produce xx, but it produces x x.
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: elein@varlena.com, scott.marlowe@ihs.com, tgl@sss.pgh.pa.us, jlim@natsoft.com.my
Subject: Re: CHAR(n) always trims trailing spaces in 7.4
In-Reply-To: <20040217162713.H25537@cookie.varlena.com>
* 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