X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 56DB99DC835 for ; Mon, 2 Jan 2006 14:05:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67386-10 for ; Mon, 2 Jan 2006 14:05:17 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 2878C9DC82F for ; Mon, 2 Jan 2006 14:05:15 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k02I5Fpi007392; Mon, 2 Jan 2006 13:05:16 -0500 (EST) To: "Sistemas C.M.P." cc: pgsql-odbc@postgresql.org Subject: Re: Function Like IsDate in pgSQL In-reply-to: <002001c60fb0$5902bc10$1601a8c0@pcsistemas> References: <002001c60fb0$5902bc10$1601a8c0@pcsistemas> Comments: In-reply-to "Sistemas C.M.P." message dated "Mon, 02 Jan 2006 12:22:30 -0300" Date: Mon, 02 Jan 2006 13:05:15 -0500 Message-ID: <7391.1136225115@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.06 required=5 tests=[AWL=0.060] X-Spam-Score: 0.06 X-Spam-Level: X-Archive-Number: 200601/5 X-Sequence-Number: 6820 "Sistemas C.M.P." writes: > I have a query that use the IsDate(string) function (Ms function). = > This function return true if the argument (string) is a valid date. > I need to implement this function in postgreSQL=20 In PG 8.0 and up this is trivial --- try to cast the string to date and see if you get an error or not. Use the BEGIN ... EXCEPTION syntax to catch the error and return false. regards, tom lane