Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2E110B5DBCA for ; Wed, 28 Sep 2011 12:43:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 03652-02 for ; Wed, 28 Sep 2011 15:43:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id B227BB5DBC8 for ; Wed, 28 Sep 2011 12:43:27 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p8SFhQ3a003606; Wed, 28 Sep 2011 11:43:26 -0400 (EDT) To: "Henk Enting" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6231: weird to_timestamp behaviour with out of range values In-reply-to: <201109281455.p8SEtveU095497@wwwmaster.postgresql.org> References: <201109281455.p8SEtveU095497@wwwmaster.postgresql.org> Comments: In-reply-to "Henk Enting" message dated "Wed, 28 Sep 2011 14:55:57 +0000" Date: Wed, 28 Sep 2011 11:43:26 -0400 Message-ID: <3605.1317224606@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/217 X-Sequence-Number: 31234 "Henk Enting" 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