Re: Using YY-MM-DD date input

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using YY-MM-DD date input
Date: 2003-07-26 02:38:22
Message-ID: 200307260238.h6Q2cMg18716@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > It would be nice to specify the input and output formats independently.
>
> They are independent now.
>
> > I think we can sort of do that now, but it isn't clear. When format is
> > Postgres, US/European control whether month is first in input and
> > output. When it is ISO, the US/European only controls input for non-ISO
> > dates. It isn't very clear, but does hit the common uses.
>
> Obviously not clear, if you don't understand it ;-). Here is the
> current situation:
>
> * The output part of DateStyle is the ISO/Postgres/SQL/German setting.
> This determines the output format, and nothing else.
>
> * The input part of DateStyle is the US/European setting. This
> determines the resolution of dd vs mm during input, but only when
> the input is ambiguous --- if the code can infer which is dd and which
> is mm by range, it will do that regardless of DateStyle.
>
> The discussion last month concluded that the heuristic resolution of
> dd/mm is dangerous, and that we ought to drop the heuristics in favor
> of saying that dd/mm is resolved only on the basis of DateStyle. That's
> okay as far as it goes (I'm not very happy with it, but I understand
> that I'm outvoted on that point). The point I'm trying to make is that
> we need to extend input DateStyle so that this approach can apply to all
> commonly used two-digit-year formats, or we are going to lose
> functionality.

But we lose functionality that can't possibily be used in 2003 because
03-01-01 doesn't identify 03 as a year. This idea hasn't been used
since 2000, and will not be possible again since 2032, and I think Y2K
was enough to show us that we don't want to encourage such usage.

I think removing this functionality is a good idea, and matches our
new tightening up of the date specification.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-07-26 02:59:51 Re: Using YY-MM-DD date input
Previous Message Ron Johnson 2003-07-26 01:16:00 Re: Using YY-MM-DD date input