Re: Potential to_date(string, string) function malfunction

From: Pavel Pleva <pavel(dot)pleva(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Potential to_date(string, string) function malfunction
Date: 2019-10-09 14:22:31
Message-ID: f0bb351b-6851-8ca7-3976-5bdb72ad96b0@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks for reply, don't have access to PG v10 so good to know.

Best regards

Pavel Pleva

Dne 08. 10. 19 v 17:38 Tom Lane napsal(a):
> Pavel Pleva <pavel(dot)pleva(at)gmail(dot)com> writes:
>> I'd like to report you in my opinion weird behaviour of function
>> to_date(string, string). According to specs using format 'YYYY-MM-DD' in
>> months portion it should tolerate 01-12 and in days portion 01-31. But
>> if you try "SELECT to_date('2019-30-50', 'YYYY-MM-DD') instead of
>> throwing error it outputs "2021-07-23".
>> This is output of 'SELECT version();' on our system: "PostgreSQL 9.4.23
>> on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red
>> Hat 4.8.5-36), 64-bit"
> PG v10 and later throw an error for this.
>
> regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Vondra 2019-10-09 14:28:27 Re: BUG #16045: vacuum_db crash and illegal memory alloc after pg_upgrade from PG11 to PG12
Previous Message Tomas Vondra 2019-10-09 14:18:41 Re: BUG #16045: vacuum_db crash and illegal memory alloc after pg_upgrade from PG11 to PG12