Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

Next:From: Merlin MoncureDate: 2011-09-28 15:54:20
Subject: Re: Problems with ENUM type manipulation in 9.1
Previous:From: Tom LaneDate: 2011-09-28 15:40:37
Subject: Re: Problems with ENUM type manipulation in 9.1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group