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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Guy Rouillier <guyr-ml1(at)burntmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] FM format modifier does not remove leading zero from year
Date: 2010-02-06 21:15:09
Message-ID: 201002062115.o16LF9s18893@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Guy Rouillier wrote:
> On 1/6/2010 3:29 PM, Tom Lane wrote:
> > Guy Rouillier<guyr-ml1(at)burntmail(dot)com> writes:
> >> 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."
> >
> > *Toggles* the effect of the modifier? Egad, what drunken idiot chose
> > that specification?
>
> Eh, tomato, tomahto. If you assume that someone will strip leading
> zeroes consistently, the Oracle approach makes sense. That would be a
> reasonable assumption to make; why would I strip the zero off the month
> but leave it on the day? So, in the unusual case that you want to do
> such a thing, you are asked to use a second occurrence of FM to turn
> zero suppression back off.

I have developed the attached patch which implements FM control of YYY,
YY, and Y specifications. I also documented that we do not match
Oracle's toggle behavior. There are a few effects on regression test
output which are part of this patch.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/pgpatches/tochar_fm text/x-diff 8.1 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2010-02-06 21:18:05 Re: add column specify position
Previous Message Enrico Pirozzi 2010-02-06 20:11:50 Re: ODBC mac os

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-02-06 22:36:27 Re: BUG #5305: Postgres service stops when closing Windows session
Previous Message Tom Lane 2010-02-06 19:30:10 Re: remove contrib/xml2