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: elein <elein@varlena.com>
Cc: scott.marlowe <scott.marlowe@ihs.com>
Cc: news.postgresql.org <jlim@natsoft.com.my>
Cc: pgsql-sql@postgresql.org
Subject: Re: CHAR(n) always trims trailing spaces in 7.4
Date: Wed, 18 Feb 2004 12:05:47 -0800
Message-ID: <20040218120547.J25537@cookie.varlena.com> (raw)
In-Reply-To: <20170.1077076397@sss.pgh.pa.us>
References: <18872.1077061249@sss.pgh.pa.us>
	<Pine.LNX.4.33.0402171706530.31955-100000@css120.ihs.com>
	<20040217162713.H25537@cookie.varlena.com>
	<20170.1077076397@sss.pgh.pa.us>

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 <elein@varlena.com> 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



view thread (17+ messages)  latest in thread

Message-ID: <20040218120547.J25537@cookie.varlena.com>
Permalink:  ../20040218120547.J25537@cookie.varlena.com/
Also on:    postgresql.org/message-id/20040218120547.J25537@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, scott.marlowe@ihs.com, jlim@natsoft.com.my
  Subject: Re: CHAR(n) always trims trailing spaces in 7.4
  In-Reply-To: <20040218120547.J25537@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