Re: Why length(to_char(1::integer, '9')) = 2 ? - Mailing list pgsql-general

From Dmitriy Igrishin
Subject Re: Why length(to_char(1::integer, '9')) = 2 ?
Date
Msg-id AANLkTimg+nxacxBpyc=iVSaGPro1iYCTxQRN=D9+eiGb@mail.gmail.com
Whole thread Raw
In response to Re: Why length(to_char(1::integer, '9')) = 2 ?  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Why length(to_char(1::integer, '9')) = 2 ?  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general


2011/3/9 Pavel Stehule <pavel.stehule@gmail.com>
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?
Do you mean the case of MI ?
So, is this leading space reserved for a sign of number by default ?

Regards

Pavel

>
> --
> // Dmitriy.
>
>
>



--
// Dmitriy.


pgsql-general by date:

Previous
From: Sim Zacks
Date:
Subject: Re: Why length(to_char(1::integer, '9')) = 2 ?
Next
From: Pavel Stehule
Date:
Subject: Re: Why length(to_char(1::integer, '9')) = 2 ?