pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Pleva <pavel.pleva@gmail.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Potential to_date(string, string) function malfunction
Date: Tue, 8 Oct 2019 14:30:56 +0200
Message-ID: <05d1d8b7-d1de-1ec7-7652-5b7ff5deaa65@gmail.com> (raw)

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

Attachments:

ToDatePostgreSql.png (image/png, 5.2K) download view image

view thread (3+ messages)  latest in thread

Message-ID: <05d1d8b7-d1de-1ec7-7652-5b7ff5deaa65@gmail.com>
Permalink:  ../05d1d8b7-d1de-1ec7-7652-5b7ff5deaa65@gmail.com/
Also on:    postgresql.org/message-id/05d1d8b7-d1de-1ec7-7652-5b7ff5deaa65@gmail.com

 · 

reply

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: pavel.pleva@gmail.com
  Subject: Re: Potential to_date(string, string) function malfunction
  In-Reply-To: <05d1d8b7-d1de-1ec7-7652-5b7ff5deaa65@gmail.com>
  References: <05d1d8b7-d1de-1ec7-7652-5b7ff5deaa65@gmail.com>

* 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