Re: TO_DATE Function unintended behavior when month value is greaterthan 12 - Mailing list pgsql-bugs

From Pavel Stehule
Subject Re: TO_DATE Function unintended behavior when month value is greaterthan 12
Date
Msg-id CAFj8pRB3fp-mscbUziCdySHQhQcPkeL-ytP3oNVOZyU=WMEjvw@mail.gmail.com
Whole thread Raw
In response to TO_DATE Function unintended behavior when month value is greater than 12  (naidu rongali <rongalinaidu@gmail.com>)
List pgsql-bugs


2018-03-01 19:34 GMT+01:00 naidu rongali <rongalinaidu@gmail.com>:
Hi,
I noticed this behavior on recent release of PG database. It will be helpful to users, if this behavior is looked into. 

When executed below SQL, got unintended output when i expected it to throw error " not a valid month "

SQL executed:
select to_date('20171231','YYYYDDMM')

result:
2019-07-17

What is your version?

It should be fixed on PostgreSQL 10 and higher (there was not backport because some applications used this feature)

Regards

Pavel



 


Thank you, Naidu

pgsql-bugs by date:

Previous
From: naidu rongali
Date:
Subject: TO_DATE Function unintended behavior when month value is greater than 12
Next
From: Igor Neyman
Date:
Subject: RE: TO_DATE Function unintended behavior when month value is greaterthan 12