pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: elein <elein@varlena.com>
To: 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 15:56:11 -0800
Message-ID: <20040217155611.G25537@cookie.varlena.com> (raw)
In-Reply-To: <18872.1077061249@sss.pgh.pa.us>
References: <20040212000610.13913.qmail@web60806.mail.yahoo.com>
	<c0pdei$ho6$1@news.hub.org>
	<18611.1077059456@sss.pgh.pa.us>
	<20040217151728.E25537@cookie.varlena.com>
	<18872.1077061249@sss.pgh.pa.us>

So the problem is there. But blaming it on char was wrong.
It should be blamed on the varchar change.  Hey, I thought
the truncation was for varchar and not text? It was for both?

It would be semantically tricky to change the operator.
The precendence is to convert to text.  Now with
the implicit update of the char(n) to text for the operator
"corrupts" the char() value.

elein

On Tue, Feb 17, 2004 at 06:40:49PM -0500, 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.
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org



view thread (17+ messages)  latest in thread

Message-ID: <20040217155611.G25537@cookie.varlena.com>
Permalink:  ../20040217155611.G25537@cookie.varlena.com/
Also on:    postgresql.org/message-id/20040217155611.G25537@cookie.varlena.com

 · 

reply

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, tgl@sss.pgh.pa.us, jlim@natsoft.com.my
  Subject: Re: CHAR(n) always trims trailing spaces in 7.4
  In-Reply-To: <20040217155611.G25537@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