Re: Bug in to_timestamp().

From: amul sul <sul_amul(at)yahoo(dot)co(dot)in>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "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>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in to_timestamp().
Date: 2016-08-16 05:04:06
Message-ID: 2095313608.13325125.1471323846174.JavaMail.yahoo@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Monday, 15 August 2016 9:58 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

>On Mon, Aug 15, 2016 at 10:56 AM, amul sul <sul_amul(at)yahoo(dot)co(dot)in> wrote:
>> On Thursday, 11 August 2016 3:18 PM, Artur Zakirov
>> <a(dot)zakirov(at)postgrespro(dot)ru> wrote:

[Skipped..]
>Well, what's the Oracle behavior in any of these cases? I don't think
>we can decide to change any of this behavior without knowing that. If
>a proposed behavior change is incompatible with our previous releases,
>I think it'd better at least be more compatible with Oracle.
>Otherwise, we're just changing from an established behavior that we
>invented ourselves to a new behavior we invented ourselves, which is
>only worthwhile if it's absolutely clear that the new behavior is way
>better.

Following cases works as expected on Oracle (except 3rd one asking input value for &15).

>> SELECT TO_TIMESTAMP('2015-12-31 13:43:36', 'YYYY MM DD HH24 MI SS');
>> SELECT TO_TIMESTAMP('2011$03!18 23_38_15', 'YYYY-MM-DD HH24:MI:SS');
>> SELECT TO_TIMESTAMP('2011*03*18 23^38&15', 'YYYY-MM-DD HH24:MI:SS');
>> SELECT TO_TIMESTAMP('2011*03!18 #%23^38$15', 'YYYY-MM-DD$$$HH24:MI:SS');

And rest throwing error as shown below:

>> SELECT TO_TIMESTAMP('2016-06-13 99:99:99', 'YYYY-MM-DD HH24:MI:SS');
ERROR at line 1:
ORA-01850: hour must be between 0 and 23

>> SELECT TO_TIMESTAMP('2016-02-30 15:43:36', 'YYYY-MM-DD HH24:MI:SS');
ERROR at line 1:
ORA-01839: date not valid for month specified

>(Also, note that text formatted email is generally preferred to HTML
>on this mailing list; the fact that your email is in a different font
>than the rest of the thread makes it hard to read.)

Understood. Will try to follow this, thanks.

Regards,
Amul Sul

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rushabh Lathia 2016-08-16 05:05:23 Re: [parallel query] random server crash while running tpc-h query on power2
Previous Message Amit Langote 2016-08-16 04:45:47 Re: Fix comment in ATExecValidateConstraint