Re: FM format modifier does not remove leading zero from year - Mailing list pgsql-general

From Adrian Klaver
Subject Re: FM format modifier does not remove leading zero from year
Date
Msg-id 201001050727.45550.aklaver@comcast.net
Whole thread Raw
In response to FM format modifier does not remove leading zero from year  ("Andrus" <kobruleht2@hot.ee>)
Responses Re: FM format modifier does not remove leading zero from year  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: optimisations to aggregates
Next
From: Antonio Goméz Soto
Date:
Subject: Using table name in column for joining