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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why length(to_char(1::integer, '9')) = 2 ?
Date: 2011-03-09 13:15:36
Message-ID: AANLkTi=+JLX_dUo30_BJ8kfK0tg3G3OFYyb0i=2XbAiz@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2011/3/9 Dmitriy Igrishin <dmitigr(at)gmail(dot)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?

Regards

Pavel

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2011-03-09 13:19:18 Re: Why length(to_char(1::integer, '9')) = 2 ?
Previous Message Dmitriy Igrishin 2011-03-09 13:12:37 Why length(to_char(1::integer, '9')) = 2 ?