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 15D84D1E023 for ; Wed, 18 Feb 2004 20:09:10 +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 63645-09 for ; Wed, 18 Feb 2004 16:09:10 -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 3D11CD1DF05 for ; Wed, 18 Feb 2004 16:09:08 -0400 (AST) Received: by cookie.varlena.com (Postfix on SuSE Linux 7.3 (i386), from userid 500) id E237938C85; Wed, 18 Feb 2004 12:05:47 -0800 (PST) Date: Wed, 18 Feb 2004 12:05:47 -0800 From: elein To: Tom Lane Cc: elein , "scott.marlowe" , "news.postgresql.org" , pgsql-sql@postgresql.org Subject: Re: CHAR(n) always trims trailing spaces in 7.4 Message-ID: <20040218120547.J25537@cookie.varlena.com> Mail-Followup-To: Tom Lane , "scott.marlowe" , "news.postgresql.org" , pgsql-sql@postgresql.org References: <18872.1077061249@sss.pgh.pa.us> <20040217162713.H25537@cookie.varlena.com> <20170.1077076397@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170.1077076397@sss.pgh.pa.us> User-Agent: Mutt/1.3.22.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/257 X-Sequence-Number: 16947 So exactly what is the order of casts that produces different results with: 'x' || ' ' || 'x' and 'x' || ' '::char15 || 'x' Are operators being invoked both (text,text)? I'm trying to understand the precedence that causes the different results. elein On Tue, Feb 17, 2004 at 10:53:17PM -0500, Tom Lane wrote: > elein writes: > > Apparently the ::char is cast to varchar and then text? > > No, directly to text, because the || operator is defined as taking text > inputs. But there's no practical difference between text and varchar on > this point. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org