pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: infinite77derger@gmail.com
Subject: BUG #15351: to_date() function bug
Date: Fri, 24 Aug 2018 15:42:43 +0000
Message-ID: <153512536372.1489.18196536375179237149@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15351
Logged by:          Василий Пупкин
Email address:      infinite77derger@gmail.com
PostgreSQL version: 10.4
Operating system:   Ubuntu
Description:        

Hi!
I have version: PostgreSQL 10.4 (Debian 10.4-2.pgdg90+1) on
x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0
20170516, 64-bit

And there is a bug in to_date()  function:

All dates, that are less then '04.01.0001', returns in Before Christ (!)
format.

Examples:
SELECT to_date('01.12.0000', 'DD.MM.YYYY'); - -   converts to 0001-12-01 BC
(Before Christ)
SELECT to_date('01.01.0000', 'DD.MM.YYYY'); - -   converts to 0001-01-01
BC
SELECT to_date('01.01.0001', 'DD.MM.YYYY'); - -   converts to 0001-01-01
BC
SELECT to_date('01.01.0001 whatever', 'DD.MM.YYYY'); - -  converts to
0001-01-01 BC
SELECT  to_date('', 'DD.MM.YYYY'); - - empty text also converts to
0001-01-01 BC

SELECT to_date('03.01.0001', 'DD.MM.YYYY'); - - converts to 0001-01-03 BC
But
SELECT to_date('04.01.0001', 'DD.MM.YYYY'); - - converts to 0001-01-04 -
correct



view thread (2+ messages)  latest in thread

Message-ID: <153512536372.1489.18196536375179237149@wrigleys.postgresql.org>
Permalink:  ../153512536372.1489.18196536375179237149@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/153512536372.1489.18196536375179237149@wrigleys.postgresql.org

 · 

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: noreply@postgresql.org, infinite77derger@gmail.com
  Subject: Re: BUG #15351: to_date() function bug
  In-Reply-To: <153512536372.1489.18196536375179237149@wrigleys.postgresql.org>
  References: <153512536372.1489.18196536375179237149@wrigleys.postgresql.org>

* 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