Re: dealing with invalid date

From: "Scott Marlowe" <smarlowe(at)qwest(dot)net>
To: "Mage" <mage(at)mage(dot)hu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: dealing with invalid date
Date: 2004-10-17 04:05:11
Message-ID: 1097985911.21035.12.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 2004-10-16 at 21:03, Mage wrote:
> Hi,
>
> can pgsql acceppt invalid date values? Sometimes it would be nice to
> convert 2003-02-29 to 2003-03-01 or to 2003-02-28 automatically instead
> of throwing back an error message.

If you're using a language with a date / time lib that does that, just
massage it through there first.

PostgreSQL is known for following the SQL spec, and more importantly for
considering your data to be important. Carelessly munging dates to fit
them into a date field is a bad thing when it comes to your data.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Net Virtual Mailing Lists 2004-10-17 04:07:40 Re: Tsearch2 trigger firing...
Previous Message Tom Lane 2004-10-17 03:56:58 Re: pgsql function using C++?, or at least C interfacing with C++ lib?