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

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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Henk Enting <h(dot)d(dot)enting(at)mgrid(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6231: weird to_timestamp behaviour with out of range values
Date: 2011-09-29 15:39:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
On Wed, Sep 28, 2011 at 11:43 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "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.

Well, you might want to insist that the input is in some particular
format, rather than just "whatever the input function will accept"...

Robert Haas
The Enterprise PostgreSQL Company

In response to


pgsql-bugs by date

Next:From: Peter GeogheganDate: 2011-09-29 20:26:36
Subject: "no relation entry for relid 1"
Previous:From: Christopher BrowneDate: 2011-09-29 12:26:06
Subject: Re: PostGre compatible to RHEL 6.1

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