Re: [GENERAL] ISO week dates - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [GENERAL] ISO week dates
Date
Msg-id 200702161631.l1GGV7i07303@momjian.us
Whole thread Raw
In response to Re: [GENERAL] ISO week dates  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-patches
Alvaro Herrera wrote:
> > > > The same situation can arise if the user mixes ISO and Gregorian data;
> > > > how should Postgres deal with something like to_date('2006-250',
> > > > 'IYYY-DDD')?  The current behaviour in my patch is actually to assume
> > > > that the user meant to say 'IYYY-IDDD', since "the 250th Gregorian day
> > > > of the ISO year 2006" is total gibberish.  But perhaps it should be
> > > > throwing an error message.
>
> My thinking is that erroneous patterns should throw an error, and not
> try to second-guess the user.  (IIRC this was being discussed in some
> other thread not long ago).

The author is working to consistently throw an error for all invalid
patterns.  Right now, the patch just tries to do its best, which is
unfortunately consistent with what the rest of the code currently does.
:-)

--
  Bruce Momjian  <bruce@momjian.us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

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

pgsql-patches by date:

Previous
From: David Fetter
Date:
Subject: Re: patch adding new regexp functions
Next
From: Peter Eisentraut
Date:
Subject: Re: patch adding new regexp functions