Re: to_char bug? - Mailing list pgsql-general

From Ben Trewern
Subject Re: to_char bug?
Date
Msg-id d01c8j$2d6t$1@news.hub.org
Whole thread Raw
In response to to_char bug?  ("Ben Trewern" <bendottrewern@mowlem.com>)
Responses Re: to_char bug?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
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@sss.pgh.pa.us> wrote in message
news:794.1109627049@sss.pgh.pa.us...
> "Ben Trewern" <bendottrewern@mowlem.com> 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@postgresql.org
>



pgsql-general by date:

Previous
From: Keith Tsao
Date:
Subject: Replication from other SQL Server
Next
From: Dorian Büttner
Date:
Subject: Re: Database Name