Re: Junk date getting uploaded into date field

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Junk date getting uploaded into date field
Date: 2013-11-06 08:59:36
Message-ID: 527A04F8.6030409@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/5/2013 10:29 AM, Steve Crawford wrote:
> The to_date and to_timestamp functions do minimal input error-checking
> and are intended for conversion of non-standard formats that cannot be
> handled by casting. These functions will attempt to convert illegal
> dates to the best of their ability, e.g. to_date('33-OCT-2013',
> 'dd-mon-yyyy') will return 2013-11-02. Users of these functions are
> advised to perform whatever external error-checking they deem prudent.

I think this should also point out that this behavior is different than
cast, which is much stricter.

the fact that these two methods are polar opposites in this behavior is
troublesome.

--
john r pierce 37N 122W
somewhere on the middle of the left coast

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Burek 2013-11-06 09:06:51 Is it advisable to pg_upgrade directly from 9.0 to 9.3?
Previous Message Massimo Ortensi 2013-11-06 08:56:22 Where can I find the 9.3 beta1 rpm now ?