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

Поиск
Список
Период
Сортировка
От elein
Тема Re: CHAR(n) always trims trailing spaces in 7.4
Дата
Msg-id 20040217162713.H25537@cookie.varlena.com
обсуждение исходный текст
Ответ на Re: CHAR(n) always trims trailing spaces in 7.4  ("scott.marlowe" <scott.marlowe@ihs.com>)
Ответы Re: CHAR(n) always trims trailing spaces in 7.4  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Apparently the ::char is cast to varchar and then text?
That explains x || ' ' || x

On Tue, Feb 17, 2004 at 05:07:24PM -0700, scott.marlowe wrote:
> On Tue, 17 Feb 2004, Tom Lane wrote:
> 
> > elein <elein@varlena.com> writes:
> > > This is an example of the problem.  It used to expand
> > > the middle thing to 15.
> > 
> > > elein=# select 'x' || ' '::char(15) || 'x';
> > >  ?column? 
> > > ----------
> > >  xx
> > > (1 row)
> > 
> > Still does, but then the spaces go away again when the value goes into
> > the concatenation, because concatenation is a text operator.
> 
> But then this:
> 
> select 'x'||' '||'x'
> 
> should produce xx, but it produces x x.


В списке pgsql-sql по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Re: CHAR(n) always trims trailing spaces in 7.4
Следующее
От: Tom Lane
Дата:
Сообщение: Re: CHAR(n) always trims trailing spaces in 7.4