Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-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

pgsql-hackers by date

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

pgsql-general by date

Next:From: Antonio Gom├ęz SotoDate: 2010-01-05 15:30:25
Subject: Using table name in column for joining
Previous:From: Sam MasonDate: 2010-01-05 15:26:48
Subject: optimisations to aggregates

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group