Re: Date input changed in 7.4 ?

From: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>
To: Kevin Brown <kevin(at)sysexperts(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Date input changed in 7.4 ?
Date: 2003-08-28 05:07:14
Message-ID: Pine.LNX.4.44.0308280654411.31606-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 27 Aug 2003, Kevin Brown wrote:

> There are some cases where it's extremely useful for PostgreSQL to
> accept dates of any format it knows about (ambiguities should be
> resolved either by looking at the current DateStyle or, failing that, by
> applying the recognition in a well-defined order

And the argument bhen this was that it only leads to wrong data. As I see
it, the only time you have dates in different styles is when you get it
from a human entering dates. Then he/she will enter 01/30/03 and it is
interpreted as 2003 January 30, he/she feels happy and enters another date
in january, say 01/10/03 and now maybe it is interpreted as 2003 October
1. Of course that error is not noticed since it worked the previous time..

Even when the dates are generated by a program one should set the
datertyle to match what the program outputs, otherwise one are in trouble
anyway. If the program generate 01/10/03 pg must know what it means and
can not just guess.

I think it is a great change. Having the database guess what you mean
should at least not be the default. Having GuessDates as a variable could
be useful and I thought that was the decision back then (what the
variable was called I don't remember).

--
/Dennis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2003-08-28 05:46:58 Re: [HACKERS] 2-phase commit
Previous Message Tom Lane 2003-08-28 05:06:46 Re: Beta2 Tag'd and Bundled ...