Re: CHAR(n) always trims trailing spaces in 7.4 - Mailing list pgsql-sql

From elein
Subject Re: CHAR(n) always trims trailing spaces in 7.4
Date
Msg-id 20040218120547.J25537@cookie.varlena.com
Whole thread Raw
In response to Re: CHAR(n) always trims trailing spaces in 7.4  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CHAR(n) always trims trailing spaces in 7.4
List pgsql-sql
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


pgsql-sql by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: Inserting NULL into Integer column
Next
From: "Jeremy Smith"
Date:
Subject: Re: Inserting NULL into Integer column