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

From Guy Rouillier
Subject Re: FM format modifier does not remove leading zero from year
Date
Msg-id 4B44EDD1.3080906@burntmail.com
Whole thread Raw
In response to Re: FM format modifier does not remove leading zero from year  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: FM format modifier does not remove leading zero from year  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 1/5/2010 10:54 AM, Tom Lane wrote:
> Adrian Klaver<aklaver@comcast.net>  writes:
>>  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.
>
> Should it be?  Can anyone check how this works on Oracle?
>

Oracle states clearly in the SQL Reference manual:

"A modifier can appear in a format model more than once. In such a case,
each subsequent occurrence toggles the effects of the modifier."

I get the following results:

select to_char(DATE'2009-1-1','FMDD.FMMM.FMYY') from dual;

1.01.9

select to_char(DATE'2009-1-1','FM DD.MM.YY') from dual

1.1.9

--
Guy Rouillier

pgsql-general by date:

Previous
From: Erik Jones
Date:
Subject: Re: How psql source code can be protected?
Next
From: Scott Marlowe
Date:
Subject: Re: How psql source code can be protected?