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

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: "Andrus" <kobruleht2(at)hot(dot)ee>
Subject: Re: FM format modifier does not remove leading zero from year
Date: 2010-01-05 15:27:45
Message-ID: 201001050727.45550.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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(at)comcast(dot)net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Antonio Goméz Soto 2010-01-05 15:30:25 Using table name in column for joining
Previous Message Sam Mason 2010-01-05 15:26:48 optimisations to aggregates

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-01-05 15:29:44 Re: execute sql commands in core
Previous Message Bruce Momjian 2010-01-05 15:27:24 Re: pg_migrator issues