Handling of pad characters (was RE: Oracle buys Innobase )

Поиск
Список
Период
Сортировка
От Guy Rouillier
Тема Handling of pad characters (was RE: Oracle buys Innobase )
Дата
Msg-id CC1CF380F4D70844B01D45982E671B239E8BF7@mtxexch01.add0.masergy.com
обсуждение исходный текст
Ответы Re: Handling of pad characters (was RE: Oracle buys Innobase )  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> Alex Turner <armtuk@gmail.com> writes:
>> It appears that casting to a char() causes spaces to be stripped
>> (ignored) from the string:
> mls=# select length('123 '::char(8));
> length
> --------
> 3
> (1 row)
>
>> I'm not sure about anyone else, but I would personaly consider that a
>> bug?
>
> No, it's a feature, as per extensive discussion some time ago when we
> made it do that.  The general rule is that trailing spaces in a
> char(n) are semantically insignificant.

How did you reach the opposite conclusion for varchar?  If anything, I
would think that stripping pad characters makes more sense for varchar
than it does for char.  But that may simply be bias from experience, as
my first real DBA work was with DB2, where fixed length columns really
are fixed length.

--
Guy Rouillier


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

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Re: looking for alternative to MySQL's GROUP_CONCAT function
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Select all invalid e-mail addresses