Search Postgresql Archives

Re: to_char bug?

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

 



>From the docs:

"FM suppresses leading zeroes and trailing blanks that would otherwise be 
added to make the output of a pattern be fixed-width"

It works now but for one I don't understand why the space is added in the 
firs place and two I think the docs don't tell the whole story ie leading 
blanks and I assume trailing zeros if applicable.

Regards,

Ben

"Tom Lane" <tgl@xxxxxxxxxxxxx> wrote in message 
news:794.1109627049@xxxxxxxxxxxxxxxx
> "Ben Trewern" <bendottrewern@xxxxxxxxxx> writes:
>> It seems that to_char(1, '000') gives a string " 001" with a space in 
>> front.
>> Is this a bug?
>
> No.
>
> Possibly you want 'FM000'.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx
> 



---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[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