pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: 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 18:10:56 -0500
Message-ID: <18611.1077059456@sss.pgh.pa.us> (raw)
In-Reply-To: <c0pdei$ho6$1@news.hub.org>
References: <20040212000610.13913.qmail@web60806.mail.yahoo.com>
	<c0pdei$ho6$1@news.hub.org>

"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



view thread (17+ messages)  latest in thread

Message-ID: <18611.1077059456@sss.pgh.pa.us>
Permalink:  ../18611.1077059456@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18611.1077059456@sss.pgh.pa.us

 · 

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