Re: [HACKERS] Bug in to_timestamp().

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, amul sul <sulamul(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Alex Ignatov <a(dot)ignatov(at)postgrespro(dot)ru>, Bruce Momjian <bruce(at)momjian(dot)us>, amul sul <sul_amul(at)yahoo(dot)co(dot)in>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Bug in to_timestamp().
Date: 2018-01-12 01:48:40
Message-ID: CAEepm=1Y7z1VSisBKxa6x3E-jP-+=rWfw25q_PH2nGjqVcX-rw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 23, 2017 at 4:23 AM, Arthur Zakirov
<a(dot)zakirov(at)postgrespro(dot)ru> wrote:
> I've attached new version of the patch. It is a little bit simpler now than the previous one.
> The patch doesn't handle backslashes now, since there was a commit which fixes quoted-substring handling recently.
> Anyway I'm not sure that this handling was necessary.
>
> I've checked queries from this thread. It seems that they give right timestamps and work like in Oracle (except different messages).
>
> The patch contains documentation and regression test fixes.

I'm guessing that commit 11b623dd0a2c385719ebbbdd42dd4ec395dcdc9d had
something to do with the following failure, when your patch is
applied:

horology ... FAILED

========= Contents of ./src/test/regress/regression.diffs
*** /home/travis/build/postgresql-cfbot/postgresql/src/test/regress/expected/horology.out
2018-01-11 17:11:49.744128698 +0000
--- /home/travis/build/postgresql-cfbot/postgresql/src/test/regress/results/horology.out
2018-01-11 17:18:53.988815652 +0000
***************
*** 2972,2978 ****
SELECT to_timestamp('2011-12-18 11:38 -05', 'YYYY-MM-DD HH12:MI TZH');
to_timestamp
------------------------------
! Sun Dec 18 08:38:00 2011 PST
(1 row)

SELECT to_timestamp('2011-12-18 11:38 +05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
--- 2972,2978 ----
SELECT to_timestamp('2011-12-18 11:38 -05', 'YYYY-MM-DD HH12:MI TZH');
to_timestamp
------------------------------
! Sat Dec 17 22:38:00 2011 PST
(1 row)

SELECT to_timestamp('2011-12-18 11:38 +05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
***************
*** 2984,2990 ****
SELECT to_timestamp('2011-12-18 11:38 -05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
to_timestamp
------------------------------
! Sun Dec 18 08:58:00 2011 PST
(1 row)

SELECT to_timestamp('2011-12-18 11:38 20', 'YYYY-MM-DD HH12:MI TZM');
--- 2984,2990 ----
SELECT to_timestamp('2011-12-18 11:38 -05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
to_timestamp
------------------------------
! Sat Dec 17 22:18:00 2011 PST
(1 row)

SELECT to_timestamp('2011-12-18 11:38 20', 'YYYY-MM-DD HH12:MI TZM');
======================================================================

--
Thomas Munro
http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2018-01-12 01:54:53 Re: numeric regression test passes, but why?
Previous Message Tatsuro Yamada 2018-01-12 01:45:48 Re: add queryEnv to ExplainOneQuery_hook