Re: TO_DATE Function unintended behavior when month value is greater than 12

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: naidu rongali <rongalinaidu(at)gmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: TO_DATE Function unintended behavior when month value is greater than 12
Date: 2018-03-01 19:26:36
Message-ID: CAFj8pRB3fp-mscbUziCdySHQhQcPkeL-ytP3oNVOZyU=WMEjvw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

2018-03-01 19:34 GMT+01:00 naidu rongali <rongalinaidu(at)gmail(dot)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
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Igor Neyman 2018-03-01 19:28:44 RE: TO_DATE Function unintended behavior when month value is greater than 12
Previous Message naidu rongali 2018-03-01 18:34:06 TO_DATE Function unintended behavior when month value is greater than 12