Re: BUG #6231: weird to_timestamp behaviour with out of range values - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6231: weird to_timestamp behaviour with out of range values
Date
Msg-id 3605.1317224606@sss.pgh.pa.us
Whole thread Raw
In response to BUG #6231: weird to_timestamp behaviour with out of range values  ("Henk Enting" <h.d.enting@mgrid.net>)
Responses Re: BUG #6231: weird to_timestamp behaviour with out of range values
List pgsql-bugs
"Henk Enting" <h.d.enting@mgrid.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

pgsql-bugs by date:

Previous
From: Josh Kupershmidt
Date:
Subject: Re: Problems with ENUM type manipulation in 9.1
Next
From: Merlin Moncure
Date:
Subject: Re: Problems with ENUM type manipulation in 9.1