Re: [GENERAL] Date conversion using day of week - Mailing list pgsql-hackers

From Steve Crawford
Subject Re: [GENERAL] Date conversion using day of week
Date
Msg-id 4D94C50C.6070202@pinpointresearch.com
Whole thread Raw
In response to Re: [GENERAL] Date conversion using day of week  (Brendan Jurd <direvus@gmail.com>)
Responses Re: [GENERAL] Date conversion using day of week  (Brendan Jurd <direvus@gmail.com>)
List pgsql-hackers
On 03/31/2011 10:51 AM, Brendan Jurd wrote:
>
> I agree with your summary of the ISO standards.  Unfortunately,
> to_date and its cohorts are not targeting ISO.  They are targeting
> quasi-compatibility with some Oracle functions of the same name, I
> suppose to make life easier for folks who are migrating from Oracle to
> Postgres.  Any proposed reform of these (admittedly weird and kludgy)
> functions is viewed through that lens, and usually rejected on those
> grounds.  I've been down that road before.  There's not much point
> having compatibility functions if they aren't, well, compatible.
>
> In the big picture, to_date isn't meant to be the general entry point
> for parsing dates.  If you wanted to make ISO8601 work as a syntax for
> inputting date type literals vis. SELECT date '2011-W14-01', you might
> have a better shot at getting that off the ground.
>
Well, to return to the original issue, should we allow the day to be
spelled out and fix it (as noted in this thread it is non-standard but
also unambiguous and we already allow plenty of non-standard formats) or
throw an error? For me personally, either would be fine. What isn't
correct is the current behavior:

select to_date('2011-13-SUN', 'IYYY-IW-DY');
   to_date
------------
  2011-03-28

Cheers,
Steve


pgsql-hackers by date:

Previous
From: Dan Ports
Date:
Subject: Re: SSI bug?
Next
From: "Kevin Grittner"
Date:
Subject: Re: SSI bug?