Re: BUG #6231: weird to_timestamp behaviour with out of range values

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Henk Enting" <h(dot)d(dot)enting(at)mgrid(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6231: weird to_timestamp behaviour with out of range values
Date: 2011-09-28 15:43:26
Message-ID: 3605.1317224606@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Henk Enting" <h(dot)d(dot)enting(at)mgrid(dot)net> writes:
> I would expect the to_timestamp function to return an error when I feed it
> out of range values, e.g. months > 13 and days > 31. Instead it seems to add
> the surplus to the timestamp and then return it.

What is your reason for using to_timestamp at all? The timestamp input
converter is perfectly capable of dealing with standard formats like
yyyy-mm-dd, and it does what most people expect in the way of data
validation checks.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Merlin Moncure 2011-09-28 15:54:20 Re: Problems with ENUM type manipulation in 9.1
Previous Message Josh Kupershmidt 2011-09-28 15:40:37 Re: Problems with ENUM type manipulation in 9.1