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 C6C0FD1B860 for ; Thu, 19 Feb 2004 20:06:27 +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 01285-07 for ; Thu, 19 Feb 2004 16:06:27 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 2FFA6D1B4C5 for ; Thu, 19 Feb 2004 16:06:25 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i1JK6LYr008637; Thu, 19 Feb 2004 15:06:21 -0500 (EST) To: elein Cc: "scott.marlowe" , "news.postgresql.org" , pgsql-sql@postgresql.org Subject: Re: CHAR(n) always trims trailing spaces in 7.4 In-reply-to: <20040219105505.S25537@cookie.varlena.com> References: <18872.1077061249@sss.pgh.pa.us> <20040217162713.H25537@cookie.varlena.com> <20170.1077076397@sss.pgh.pa.us> <20040218120547.J25537@cookie.varlena.com> <28866.1077166717@sss.pgh.pa.us> <20040219105505.S25537@cookie.varlena.com> Comments: In-reply-to elein message dated "Thu, 19 Feb 2004 10:55:05 -0800" Date: Thu, 19 Feb 2004 15:06:21 -0500 Message-ID: <8636.1077221181@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/287 X-Sequence-Number: 16977 elein writes: > Somewhere the space trimming occurs. The cast from char(n) to text (or varchar) is what's doing the trimming in 7.4. I think you can mostly revert the change by changing that pg_cast entry to specify no conversion function instead of rtrim(). However that would probably result in squirrely, non-spec behavior for comparisons. > If char(n) is properly defined to not trim spaces then > there should be a separate cat for char(n). Possibly, but I think that is considering the issue much too narrowly. Concatenation is not the only textual operator. regards, tom lane