Re: to_timestamp error handling.

From: Dhaval Jaiswal <dhaval(dot)jaiswal(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <stark(at)enterprisedb(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: to_timestamp error handling.
Date: 2009-06-10 15:02:45
Message-ID: c5a53f7b0906100802k2ad4a804na9003982d49ab587@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Yes, there isn't a use case for a month value outside 1-12, i found this
due a typo.

On Wed, Jun 10, 2009 at 8:12 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Greg Stark <stark(at)enterprisedb(dot)com> writes:
> > On Wed, Jun 10, 2009 at 3:23 PM, Dhaval
> > Jaiswal<dhaval(dot)jaiswal(at)enterprisedb(dot)com> wrote:
> >> postgres=# select to_timestamp('20096010','YYYYMMDD');
> >> ---------------------------
> >> 2013-12-18 00:00:00+05:30
>
> > I suspect you'll find that the 60th month after the start of 2009 is
> > in fact december 2013.
>
> Yeah. I was kind of surprised that CVS HEAD doesn't complain about this
> --- I thought we'd tightened up the error checking in to_timestamp.
>
> I think it's been occasionally seen as a feature that something like
> '2009-02-29' will be read as '2009-03-01', but it's hard to imagine a
> real use case for month outside 1-12.
>
> regards, tom lane
>

--
Thanks & Regards,
Dhaval Jaiswal
EnterpriseDB
Contact: 732-331-1300 Ext- 2022
+91-20-30589 516 / 494
web: www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Simon Bertrang 2009-06-10 15:07:18 Re: patch to fix configure(.in) on openbsd wrt/ krb5/com_err and readline linking
Previous Message Tom Lane 2009-06-10 14:42:02 Re: to_timestamp error handling.