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

From Igor Neyman
Subject RE: TO_DATE Function unintended behavior when month value is greaterthan 12
Date
Msg-id CO2PR17MB0058CA3B1C32ECCEBAC4BD66DAC60@CO2PR17MB0058.namprd17.prod.outlook.com
Whole thread Raw
In response to TO_DATE Function unintended behavior when month value is greater than 12  (naidu rongali <rongalinaidu@gmail.com>)
Responses Re: TO_DATE Function unintended behavior when month value is greaterthan 12  (Pantelis Theodosiou <ypercube@gmail.com>)
List pgsql-bugs

 

From: naidu rongali [mailto:rongalinaidu@gmail.com]
Sent: Thursday, March 01, 2018 1:34 PM
To: pgsql-bugs@postgresql.org
Subject: TO_DATE Function unintended behavior when month value is greater than 12

 

Attention: This email was sent from someone outside of Perceptron. Always exercise caution when opening attachments or clicking links from unknown senders or when receiving unexpected emails.

 

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

 

 

Thank you, Naidu

 

I get this:

ERROR: date/time field value out of range: "20171231" SQL state: 22008

 

Regards,

Igor Neyman

 

pgsql-bugs by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: TO_DATE Function unintended behavior when month value is greaterthan 12
Next
From: Pantelis Theodosiou
Date:
Subject: Re: TO_DATE Function unintended behavior when month value is greaterthan 12