From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | Ravi Krishna <sr_krishna(at)aol(dot)com>, Kevin Brannen <KBrannen(at)efji(dot)com> |
Cc: | "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: date function bug |
Date: | 2019-10-23 16:31:51 |
Message-ID: | f4b30601-5980-cf44-a83a-59b6332d2de0@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 10/23/19 7:55 AM, Ravi Krishna wrote:
>>
>> ====================
>>
>> Surprisingly (to me), no….
>>
>> db=# select to_date('20181501','YYYYMMDD');
>> to_date
>> ------------
>> 2019-03-03
>
> The above fails in 11.5 SQL Error [22008]: ERROR: date/time field value out of range: "20181501"
>
Behavior changed in v10:
https://www.postgresql.org/docs/10/release-10.html
"
Make to_timestamp() and to_date() reject out-of-range input fields
(Artur Zakirov)
For example, previously to_date('2009-06-40','YYYY-MM-DD') was accepted
and returned 2009-07-10. It will now generate an error.
"
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2019-10-23 16:40:20 | Re: Is this a bug ? |
Previous Message | Ron | 2019-10-23 16:30:25 | Re: Is this a bug ? |