Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/09/2011 03:12 PM, Dmitriy Igrishin wrote:

> 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 ?
>
> --
> // Dmitriy.
>
>
I don't know why, but to work around it use:
select to_char(1, 'FM9');
select length(to_char(1, 'FM9'));

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNd3/JAAoJEHr2Gm0ENObOsUMH/ApWyfc5c5A56m1pAP7raIEd
dmY0/aocCCnQbariREZIGSJPrmcWDKnNe3yNLjV2Y3+EY+eaicxy2GPTVamOrfqN
tYQ/ImH3IkrzQk1bfRX+lnUJQGEmMi8ClzAatKUIifGJwMuj7y1xUl/VBTP0lBvI
GuQQaElNkpGaPRTJZlorrtqEBgWmiyBT07gK02IST9xFsUPnrF0niNlqcaphF2Ga
kKgFfVJ8u/C3KbwowVPh5GYZHgIM1T8x6SPzpcsnFVrIGN+avnuvdEInxomCZDNN
FLuRBEPK9NFTG6rdIyrtfy5C6HVm/q7rO1alW0hjuszou1t2gBCOkmXtva9V5gY=
=pGTI
-----END PGP SIGNATURE-----


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux