Re: FM format modifier does not remove leading zero from year

Adrian Klaver <aklaver@comcast.net>

From: Adrian Klaver <aklaver@comcast.net>
To: pgsql-general@postgresql.org
Cc: "Andrus" <kobruleht2@hot.ee>
Date: 2010-01-05T15:27:45Z
Lists: pgsql-hackers, pgsql-general
On Saturday 02 January 2010 10:14:07 am Andrus wrote:
> Command:
>
> select to_char(DATE'2009-1-1','FMDD.FMMM.FMYY')
>
> Result observed:
>
> 1.1.09
>
> Result expected:
>
> 1.1.9
>
> How to fix ?
>
> Andrus.

From what I could see in the source code (src/backend/utils/adt/formatting.c) 
the year portion of the string is not run through the FM modifier. A fix would 
mean a patch to the above AFAIK.

-- 
Adrian Klaver
aklaver@comcast.net