Potential to_date(string, string) function malfunction

From: Pavel Pleva <pavel(dot)pleva(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Potential to_date(string, string) function malfunction
Date: 2019-10-08 12:30:56
Message-ID: 05d1d8b7-d1de-1ec7-7652-5b7ff5deaa65@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

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"

Have a nice day!

Pavel Pleva

Attachment Content-Type Size
image/png 5.2 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Raymond 2019-10-08 13:36:50 RE: BUG #16031: Group by returns duplicate groups
Previous Message PG Bug reporting form 2019-10-08 10:07:13 BUG #16044: Could not send data to server