Re: Strange results from to_timestamp

From: "Adrian Maier" <adrian(dot)maier(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Strange results from to_timestamp
Date: 2006-04-07 13:03:29
Message-ID: cd30ef8c0604070603p4d36f778vdde1c411572a862e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4/7/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Mario Weilguni <mweilguni(at)sime(dot)com> writes:
> > I think all except the first one should raise a warning, isn't it?
>
> to_timestamp (and friends) all seem to me to act pretty bizarre when
> faced with input that doesn't match the given format string. However,
> in the end that is an Oracle-compatibility function, and there is only
> one measure of what it should do: what does Oracle do in the same case.
> Can anyone try these examples on a recent Oracle version?

In Oracle10g Express those dates are rejected as invalid :

SQL> select to_timestamp('00000000 0300','yyyymmdd hh24mi') from dual;
select to_timestamp('00000000 0300','yyyymmdd hh24mi') from dual
*
ERROR at line 1:
ORA-01843: not a valid month

SQL> select to_timestamp(' 0300','yyyymmdd hh24mi') from dual;
select to_timestamp(' 0300','yyyymmdd hh24mi') from dual
*
ERROR at line 1:
ORA-01843: not a valid month

Cheers,
Adrian Maier

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2006-04-07 13:05:12 GIN - Generalized Inverted iNdex.
Previous Message Mike Rylander 2006-04-07 12:59:46 Re: Support Parallel Query Execution in Executor