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: news.postgresql.org <jlim@natsoft.com.my>
Cc: pgsql-sql@postgresql.org, elein <elein@varlena.com>
Subject: Re: CHAR(n) always trims trailing spaces in 7.4
Date: Tue, 17 Feb 2004 15:17:28 -0800
Message-ID: <20040217151728.E25537@cookie.varlena.com> (raw)
In-Reply-To: <18611.1077059456@sss.pgh.pa.us>
References: <20040212000610.13913.qmail@web60806.mail.yahoo.com>
	<c0pdei$ho6$1@news.hub.org>
	<18611.1077059456@sss.pgh.pa.us>

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)


On Tue, Feb 17, 2004 at 06:10:56PM -0500, Tom Lane wrote:
> "news.postgresql.org" <jlim@natsoft.com.my> writes:
> > I just discovered the following change to CHAR(n) (taken from varlena.com,
> > general bits, issue 62).
> 
> The description you quote doesn't appear to have much of anything to do
> with the actual behavior of 7.4.
> 
> 7.4 will trim trailing spaces when converting char(n) to varchar or
> text, but the example query does not do that.  It just coerces query
> output columns to char(n), and that works the same as it did before.
> For instance
> 
> regression=# select 'zit'::char(77);
>                                     bpchar
> -------------------------------------------------------------------------------
>  zit
> (1 row)
> 
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster



view thread (17+ messages)  latest in thread

Message-ID: <20040217151728.E25537@cookie.varlena.com>
Permalink:  ../20040217151728.E25537@cookie.varlena.com/
Also on:    postgresql.org/message-id/20040217151728.E25537@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: <20040217151728.E25537@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