Re: Why length(to_char(1::integer, '9')) = 2 ?

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: Why length(to_char(1::integer, '9')) = 2 ?
Дата
Msg-id 4D777E56.8080708@iol.ie
обсуждение исходный текст
Ответ на Re: Why length(to_char(1::integer, '9')) = 2 ?  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
On 09/03/2011 13:15, Pavel Stehule wrote:
> 2011/3/9 Dmitriy Igrishin<dmitigr@gmail.com>:
>> Hey all,
>>
>> dmitigr=>  select to_char(1, '9');
>>   to_char
>> ---------
>>    1
>>
>> dmitigr=>  select length(to_char(1, '9'));
>>   length
>> --------
>>        2
>>
>> Why to_char() includes preceding blank space in the result ?
>
> it is compatibility with Oracle?

I've often wondered too why there is padding by default in certain uses
of to_char().... it's a bit of a PITA sometimes. :-)

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Why length(to_char(1::integer, '9')) = 2 ?
Следующее
От: Sim Zacks
Дата:
Сообщение: Re: Why length(to_char(1::integer, '9')) = 2 ?