Re: to_date_valid() - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: to_date_valid()
Date
Msg-id bd34ca87-211c-e99a-5130-5872a53f4b12@2ndquadrant.com
Whole thread Raw
In response to Re: to_date_valid()  (Andreas 'ads' Scherbaum <adsmail@wars-nicht.de>)
List pgsql-hackers
On 9/9/16 4:48 AM, Andreas 'ads' Scherbaum wrote:
> ValidateDate() will tell you if it's a valid date. But not if the 
> transformation was correct:
> 
> postgres=# SELECT to_date('2011 12  18', 'YYYY MM   DD');
>    to_date
> ------------
>   2011-12-08
> (1 row)
> 
> (with the patch from Artur)
> 
> 
> Any idea how to solve this problem?

I think we need to do overflow checking as we read the various values,
in do_to_timestamp() and functions called from it.  This would be very
similar to overflow checking in input functions.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: System load consideration before spawning parallel workers
Next
From: Tom Lane
Date:
Subject: Re: Hash Indexes