Skip site navigation (1) Skip section navigation (2)

Re: CHAR(n) always trims trailing spaces in 7.4

From: elein <elein(at)varlena(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: elein <elein(at)varlena(dot)com>,"scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>,"news(dot)postgresql(dot)org" <jlim(at)natsoft(dot)com(dot)my>, pgsql-sql(at)postgresql(dot)org
Subject: Re: CHAR(n) always trims trailing spaces in 7.4
Date: 2004-02-18 20:05:47
Message-ID: 20040218120547.J25537@cookie.varlena.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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(at)varlena(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Jeremy SmithDate: 2004-02-18 20:15:43
Subject: Re: Inserting NULL into Integer column
Previous:From: Bruce MomjianDate: 2004-02-18 19:52:20
Subject: Re: [PATCHES] NO WAIT ...

pgsql-sql by date

Next:From: Jeremy SmithDate: 2004-02-18 20:15:43
Subject: Re: Inserting NULL into Integer column
Previous:From: scott.marloweDate: 2004-02-18 19:43:34
Subject: Re: Inserting NULL into Integer column

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group