From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Pleva <pavel.pleva@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Potential to_date(string, string) function malfunction
Date: Tue, 08 Oct 2019 11:38:44 -0400
Message-ID: <22301.1570549124@sss.pgh.pa.us> (raw)
In-Reply-To: <05d1d8b7-d1de-1ec7-7652-5b7ff5deaa65@gmail.com>
References: <05d1d8b7-d1de-1ec7-7652-5b7ff5deaa65@gmail.com>
Pavel Pleva <pavel.pleva@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, pavel.pleva@gmail.com
Subject: Re: Potential to_date(string, string) function malfunction
In-Reply-To: <22301.1570549124@sss.pgh.pa.us>
References: <05d1d8b7-d1de-1ec7-7652-5b7ff5deaa65@gmail.com> <22301.1570549124@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox