Re: [HACKERS] Bug in to_timestamp().

From: Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>
To: a(dot)korotkov(at)postgrespro(dot)ru
Cc: sulamul(at)gmail(dot)com, david(dot)g(dot)johnston(at)gmail(dot)com, a(dot)zakirov(at)postgrespro(dot)ru, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 9erthalion6(at)gmail(dot)com, Robert Haas <robertmhaas(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, pavel(dot)stehule(at)gmail(dot)com, a(dot)ignatov(at)postgrespro(dot)ru, bruce(at)momjian(dot)us, sul_amul(at)yahoo(dot)co(dot)in, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Bug in to_timestamp().
Date: 2018-09-18 11:07:48
Message-ID: CANEvxPonsPsNWZzBK5aOO_=h1yQHODOADsVBcO6ZJWq49+dB9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi All,

Few more findings on to_timestamp() test with HEAD.

postgres[3493]=# select to_timestamp('15-07-1984 23:30:32',' dd- mm- yyyy
hh24: mi: ss');
to_timestamp
---------------------------
1984-07-15 23:30:32+05:30
(1 row)

postgres[3493]=# select to_timestamp('15-07-*1984* 23:30:32','*9*dd-*9*mm-
*99*yyyy *9*hh24:*9*mi:*9*ss');
to_timestamp
------------------------------
*0084*-07-05 03:00:02+05:53:28
(1 row)

If there are spaces before any formate then output is fine(1st output) but
instead of spaces if we have *digit* then we are getting wrong output.

On Mon, Sep 10, 2018 at 12:23 AM Alexander Korotkov <
a(dot)korotkov(at)postgrespro(dot)ru> wrote:

> On Thu, Sep 6, 2018 at 3:58 PM Alexander Korotkov <
> a(dot)korotkov(at)postgrespro(dot)ru> wrote:
>
>> On Thu, Sep 6, 2018 at 2:40 PM Alexander Korotkov
>> <a(dot)korotkov(at)postgrespro(dot)ru> wrote:
>> >
>> > On Wed, Sep 5, 2018 at 7:28 PM amul sul <sulamul(at)gmail(dot)com> wrote:
>> > > On Wed, Sep 5, 2018, 6:35 PM Alexander Korotkov <
>> a(dot)korotkov(at)postgrespro(dot)ru> wrote:
>> > >> On Wed, Sep 5, 2018 at 3:10 PM amul sul <sulamul(at)gmail(dot)com> wrote:
>> > >> > On Wed, Sep 5, 2018 at 3:05 PM Alexander Korotkov
>> > >> > <a(dot)korotkov(at)postgrespro(dot)ru> wrote:
>> > >> > > On Wed, Sep 5, 2018 at 1:22 AM David G. Johnston
>> > >> > > <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>> > >> > > > From those results the question is how important is it to
>> force the following breakage on our users (i.e., introduce FX exact symbol
>> matching):
>> > >> > > >
>> > >> > > > SELECT to_timestamp('97/Feb/16', 'FXYY:Mon:DD');
>> > >> > > > - to_timestamp
>> > >> > > > -------------------------------
>> > >> > > > - Sun Feb 16 00:00:00 1997 PST
>> > >> > > > -(1 row)
>> > >> > > > -
>> > >> > > > +ERROR: unexpected character "/", expected character ":"
>> > >> > > > +HINT: In FX mode, punctuation in the input string must
>> exactly match the format string.
>> > >> > > >
>> > >> > > > There seemed to be some implicit approvals of this breakage
>> some 30 emails and 10 months ago but given that this is the only change
>> from a correct result to a failure I'd like to officially put it out there
>> for opinion/vote gathering. Mine is a -1; though keeping the distinction
>> between space and non-alphanumeric characters is expected.
>> > >> > >
>> > >> > > Do I understand correctly that you're -1 to changes to FX mode,
>> but no
>> > >> > > objection to changes in non-FX mode?
>> > >> > >
>> > >> > Ditto.
>> > >>
>> > >> So, if no objections for non-FX mode changes, then I'll extract that
>> > >> part and commit it separately.
>> > >
>> > >
>> > > Yeah, that make sense to me, thank you.
>> >
>> > OK! I've removed FX changes from the patch. The result is attached.
>> > I'm going to commit this if no objections.
>>
>> Attached revision fixes usage of two subsequent spaces in the
>> documentation.
>>
>
> So, pushed! Thanks to every thread participant for review and feedback.
>
> ------
> Alexander Korotkov
> Postgres Professional: http://www.postgrespro.com
> The Russian Postgres Company
>

--

With Regards,

Prabhat Kumar Sahu
Skype ID: prabhat.sahu1984
EnterpriseDB Corporation

The Postgres Database Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jinhua Luo 2018-09-18 11:33:17 EXPLAIN stored procedures
Previous Message Jinhua Luo 2018-09-18 11:05:23 What is OLD in INSTEAD OF trigger?