X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 49008D1D59C for ; Tue, 17 Feb 2004 23:20:46 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 87293-05 for ; Tue, 17 Feb 2004 19:20:43 -0400 (AST) Received: from cookie.varlena.com (adsl-64-142-36-103.sonic.net [64.142.36.103]) by svr1.postgresql.org (Postfix) with ESMTP id ECF9AD1D1CD for ; Tue, 17 Feb 2004 19:20:40 -0400 (AST) Received: by cookie.varlena.com (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 2D8B438C85; Tue, 17 Feb 2004 15:17:28 -0800 (PST) Date: Tue, 17 Feb 2004 15:17:28 -0800 From: elein To: Tom Lane Cc: "news.postgresql.org" , pgsql-sql@postgresql.org, elein Subject: Re: CHAR(n) always trims trailing spaces in 7.4 Message-ID: <20040217151728.E25537@cookie.varlena.com> Mail-Followup-To: Tom Lane , "news.postgresql.org" , pgsql-sql@postgresql.org References: <20040212000610.13913.qmail@web60806.mail.yahoo.com> <18611.1077059456@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18611.1077059456@sss.pgh.pa.us> User-Agent: Mutt/1.3.22.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/231 X-Sequence-Number: 16921 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" 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