Re: A creepy story about dates. How to prevent it? - Mailing list pgsql-general

From Bruce Momjian
Subject Re: A creepy story about dates. How to prevent it?
Date
Msg-id 200306231924.h5NJOBY28989@candle.pha.pa.us
Whole thread Raw
In response to Re: A creepy story about dates. How to prevent it?  ("scott.marlowe" <scott.marlowe@ihs.com>)
Responses Re: A creepy story about dates. How to prevent it?  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general
scott.marlowe wrote:
> On Mon, 23 Jun 2003, Tom Lane wrote:
>
> > "scott.marlowe" <scott.marlowe@ihs.com> writes:
> > > The one thing that should absolutely be turned off is day/month swapping
> > > on dates of the form: 2003-02-22.
> >
> > Agreed on that.  YYYY-DD-MM isn't used in the real world AFAIK, and it's
> > reasonable to treat it as an error.
> >
> > > I've seen little actual defense of the current behaviour,
> >
> > Other than me, I think you mean.  dd/mm/yyyy and mm/dd/yyyy are
> > inherently ambiguous in the real world, and when you can clearly
> > determine what the intended meaning is, I think it's more reasonable
> > to assume the datestyle isn't set correctly than to reject the data.
>
> I thought the locale set that kind of behaviour didn't it?  If so, then
> it's better to fail loudly then quietly accept bad data.  But if the
> locale doesn't define such a thing, or it can't be set in postgresql.conf,
> the it's best to just avoid that date style altogether.

Added to TODO, with question mark:

    * Have initdb set DateStyle based on locale?

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

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: A creepy story about dates. How to prevent it?
Next
From: "scott.marlowe"
Date:
Subject: Re: Eliminating start error message: "unary operator