Re: to_timestamp error handling.

From: Greg Stark <stark(at)enterprisedb(dot)com>
To: Dhaval Jaiswal <dhaval(dot)jaiswal(at)enterprisedb(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: to_timestamp error handling.
Date: 2009-06-10 14:29:55
Message-ID: 4136ffa0906100729q77b03872gd1541fdedd897c34@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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');
>
>        to_timestamp
> ---------------------------
>  2013-12-18 00:00:00+05:30
>
> (1 row)
>
> The month is 60 in my case and it is giving some random value, whereas I am
> expecting some error message like date is not valid.

I suspect you'll find that the 60th month after the start of 2009 is
in fact december 2013.

--
Gregory Stark
http://mit.edu/~gsstark/resume.pdf

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2009-06-10 14:42:02 Re: to_timestamp error handling.
Previous Message Dhaval Jaiswal 2009-06-10 14:23:46 Re: to_timestamp error handling.