Re: Re: [GENERAL] FM format modifier does not remove leading zero from year - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Re: [GENERAL] FM format modifier does not remove leading zero from year
Date
Msg-id 20100208160719.GK4113@alvh.no-ip.org
Whole thread Raw
In response to Re: [GENERAL] FM format modifier does not remove leading zero from year  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Re: [GENERAL] FM format modifier does not remove leading zero from year  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Bruce Momjian wrote:
> Guy Rouillier wrote:
> > On 1/6/2010 3:29 PM, Tom Lane wrote:
> > > Guy Rouillier<guyr-ml1@burntmail.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.

What's the point of not following Oracle here, since this is solely an
Oracle compatibility function?


-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: damage control mode
Next
From: Alvaro Herrera
Date:
Subject: Re: Listen / Notify - what to do when the queue is full