Re: [HACKERS] Bug in to_timestamp().

From: amul sul <sulamul(at)gmail(dot)com>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: prabhat(dot)sahu(at)enterprisedb(dot)com, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Pavel Stehule <pavel(dot)stehule(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-09-19 10:38:00
Message-ID: CAAJ_b97cyyM6n8smP7Zw8HOw49+=bH0HZH1q_p-NLyZtMH+WfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 19, 2018 at 3:51 PM amul sul <sulamul(at)gmail(dot)com> wrote:
>
> On Wed, Sep 19, 2018 at 2:57 PM Alexander Korotkov
[...]
>
> With this patch, to_date and to_timestamp behaving differently, see this:
>
> edb=# SELECT to_date('18 12 2011', 'xDDxMMxYYYY');
> to_date
> --------------------
> 18-DEC-11 00:00:00
> (1 row)
>
> edb=# SELECT to_timestamp('18 12 2011', 'xDDxMMxYYYY');
> to_timestamp
> ---------------------------
> 08-DEC-11 00:00:00 -05:00 <=========== Incorrect output.
> (1 row)
>
Sorry, this was wrong info -- with this patch, I had some mine trial changes.

Both to_date and to_timestamp behaving same with your patch -- the
wrong output, we are expecting that?

postgres =# SELECT to_date('18 12 2011', 'xDDxMMxYYYY');
to_date
------------
2011-12-08
(1 row)

postgres =# SELECT to_timestamp('18 12 2011', 'xDDxMMxYYYY');
to_timestamp
------------------------
2011-12-08 00:00:00-05
(1 row)

Regards,
Amul

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Arthur Zakirov 2018-09-19 11:23:06 Re: [HACKERS] proposal: schema variables
Previous Message amul sul 2018-09-19 10:21:37 Re: [HACKERS] Bug in to_timestamp().