Re: to_timestamp error handling.

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dhaval Jaiswal <dhaval(dot)jaiswal(at)enterprisedb(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: to_timestamp error handling.
Date: 2010-02-24 20:44:37
Message-ID: 201002242044.o1OKibO21412@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > FYI, this behavior now returns:
>
> > test=> select to_timestamp('20096010','YYYYMMDD');
> > to_timestamp
> > ------------------------
> > 2013-12-18 00:00:00-05
> > (1 row)
>
> > which doesn't have the :30 but is still odd.
>
> I don't think the behavior has changed, you're merely checking it in
> a different timezone from the OP.
>
> The real question is whether we should throw error for out-of-range
> MM (or other fields). I think there are actual use cases for certain
> "invalid" inputs, like adding one to the day field without worrying
> about end of month. Perhaps there is not a use case for a month value
> as far out of range as this, but where would we draw the line?
>
> Anybody know what Oracle's to_timestamp does?

The old thread reported Oracle returned an error;

http://archives.postgresql.org/pgsql-bugs/2009-06/msg00100.php

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-02-24 21:03:10 Re: to_timestamp error handling.
Previous Message Tom Lane 2010-02-24 20:00:50 Re: to_timestamp error handling.