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

From Robert Haas
Subject Re: BUG #6231: weird to_timestamp behaviour with out of range values
Date
Msg-id CA+TgmoZymKzNU9Mxn1Abi=mojUKF_KD3B+_ecSVq39QYxDdXyg@mail.gmail.com
Whole thread Raw
In response to Re: BUG #6231: weird to_timestamp behaviour with out of range values  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #6231: weird to_timestamp behaviour with out of range values  (Henk Enting <h.d.enting@mgrid.net>)
List pgsql-bugs
On Wed, Sep 28, 2011 at 11:43 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "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? =A0The 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"...

--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-bugs by date:

Previous
From: Christopher Browne
Date:
Subject: Re: PostGre compatible to RHEL 6.1
Next
From: Peter Geoghegan
Date:
Subject: "no relation entry for relid 1"