From: Tom Lane <tgl@sss.pgh.pa.us>
To: Henk Enting <h.d.enting@mgrid.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6231: weird to_timestamp behaviour with out of range values
Date: Wed, 28 Sep 2011 11:43:26 -0400
Message-ID: <3605.1317224606@sss.pgh.pa.us> (raw)
In-Reply-To: <201109281455.p8SEtveU095497@wwwmaster.postgresql.org>
References: <201109281455.p8SEtveU095497@wwwmaster.postgresql.org>
"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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, h.d.enting@mgrid.net
Subject: Re: BUG #6231: weird to_timestamp behaviour with out of range values
In-Reply-To: <3605.1317224606@sss.pgh.pa.us>
References: <201109281455.p8SEtveU095497@wwwmaster.postgresql.org> <3605.1317224606@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox