Re: 3 digit ISO dates - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 3 digit ISO dates
Date
Msg-id 10276.1063637079@sss.pgh.pa.us
Whole thread Raw
In response to Re: 3 digit ISO dates  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Ooooh - that must have been a side effect of the 'only parse dates in set
> format' changes...was it intended?

Yes, I thought so.  The relevant bit of the change is here:

!   /***
!    * Enough digits to be unequivocal year? Used to test for 4 digits or
!    * more, but we now test first for a three-digit doy so anything
!    * bigger than two digits had better be an explicit year.
!    * - thomas 1999-01-09
!    * Back to requiring a 4 digit year. We accept a two digit
!    * year farther down. - thomas 2000-03-28
!    ***/
!   else if (flen >= 4)   {
!       *tmask = DTK_M(YEAR);

--- 2408,2498 ----

!           case 0:
!               /*
!                * Nothing so far; make a decision about what we think the
!                * input is.  There used to be lots of heuristics here, but
!                * the consensus now is to be paranoid.  It *must* be either
!                * YYYY-MM-DD (with a more-than-two-digit year field), or the
!                * field order defined by DateOrder.
!                */
!               if (flen >= 3 || DateOrder == DATEORDER_YMD)
!               {
!                   *tmask = DTK_M(YEAR);

        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: Re: SetQuerySnapshot in 7.4
Next
From: "Marc G. Fournier"
Date:
Subject: beta3 tag, bundled and available ...