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

From Frank Miles
Subject Re: A creepy story about dates. How to prevent it?
Date
Msg-id Pine.A41.4.44.0306190736380.11078-100000@homer17.u.washington.edu
Whole thread Raw
In response to Re: A creepy story about dates. How to prevent it?  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: A creepy story about dates. How to prevent it?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: A creepy story about dates. How to prevent it?  ("scott.marlowe" <scott.marlowe@ihs.com>)
List pgsql-general
On Thu, 19 Jun 2003, Bruno Wolff III wrote:

> On Thu, Jun 19, 2003 at 02:43:12 -0500,
>   Ron Johnson <ron.l.johnson@cox.net> wrote:
> >
> > OTOH, Andrew Snow's method (alway use ANSI standard YYYY-MM-DD)
> > is guaranteed to work.  Have your app convert to that format before
> > inserting, and then PostgreSQL is guaranteed to puke if there's
> > a problem.
>
> No it isn't. In 7.4:
> area=> select '2003-20-02'::date;
>     date
> ------------
>  2003-02-20
> (1 row)

If the application always passes the date to Postgres with the three-letter
month name where appropriate, and use the 4-digit year, it should be
comparatively bulletproof.  At least, bulletproof in its interpretation --
the application can always garble things.

Not sure how this translates in different languages, though.

    -frank


pgsql-general by date:

Previous
From: Paul Thomas
Date:
Subject: Re: FW: Allowing user to connect to a database?
Next
From: culley harrelson
Date:
Subject: Re: explicit joins vs implicit joins