Re: A creepy story about dates. How to prevent it?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>, Frank Miles <fpm(at)u(dot)washington(dot)edu>, Bruno Wolff III <bruno(at)wolff(dot)to>, Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: A creepy story about dates. How to prevent it?
Date: 2003-06-20 09:05:48
Message-ID: Pine.LNX.4.44.0306192142500.2087-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane writes:

> It would make sense to offer a "strict" mode in which the date order
> has to be what DateStyle suggests. I'm astonished that no one seems
> to get the point that there are also good uses for "lax" parsing.

There are different kinds of lax parsing.

Lax parsing is great if you can enter any of

January 8, 1999
1999-01-08
1/8/1999
990108
January 8 04:05:06 1999 PST

and it will know what you mean, because of all these have their uses and
are unambiguous (given a known day/month order).

But automatically switching the declared day/month order based on
heuristics is not that great. A human is not going to mentally switch his
preferred day/month order within the same SQL session.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2003-06-20 09:32:33 Re: Getting one row for each subquery row...?
Previous Message Nigel J. Andrews 2003-06-20 08:34:24 Re: Incremental backups, and backup history