X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 52876D1B590 for ; Tue, 2 Dec 2003 10:28:20 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 87855-06 for ; Tue, 2 Dec 2003 06:27:50 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id AF3EAD1B518 for ; Tue, 2 Dec 2003 06:27:48 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id hB2ARlbI066420 for ; Tue, 2 Dec 2003 10:27:47 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id hB2AHB3m065173 for pgsql-sql@postgresql.org; Tue, 2 Dec 2003 10:17:11 GMT From: CoL X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Validity check in to_date? Date: Tue, 02 Dec 2003 11:17:52 +0100 Organization: Hub.Org Networking Services Lines: 24 Message-ID: References: <20031127141125.GC87728@dyatel.antar.bryansk.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6a) Gecko/20031029 Thunderbird/0.4a X-Accept-Language: en-us, en In-Reply-To: <20031127141125.GC87728@dyatel.antar.bryansk.ru> To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/42 X-Sequence-Number: 16208 hi, SELECT isfinite(timestamp '123.45.2003'); if this is true, the date is ok, if error, than not :) C. Alexander M. Pravking wrote: > I just discovered that to_date() function does not check if supplied > date is correct, giving surprising (at least for me) results: > > fduch=# SELECT to_date('31.11.2003', 'DD.MM.YYYY'); > to_date > ------------ > 2003-12-01 > > or even > > fduch=# SELECT to_date('123.45.2003', 'DD.MM.YYYY'); > to_date > ------------ > 2007-01-03