Re: to_timestamp error handling. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: to_timestamp error handling.
Date
Msg-id 28413.1267041650@sss.pgh.pa.us
Whole thread Raw
In response to Re: to_timestamp error handling.  (Bruce Momjian <bruce@momjian.us>)
Responses Re: to_timestamp error handling.
List pgsql-bugs
Bruce Momjian <bruce@momjian.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?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: to_timestamp error handling.
Next
From: Bruce Momjian
Date:
Subject: Re: to_timestamp error handling.