Re: Function Like IsDate in pgSQL - Mailing list pgsql-odbc

From Tom Lane
Subject Re: Function Like IsDate in pgSQL
Date
Msg-id 7391.1136225115@sss.pgh.pa.us
Whole thread Raw
In response to Function Like IsDate in pgSQL  ("Sistemas C.M.P." <sistemascmp@redynet4.com.ar>)
List pgsql-odbc
"Sistemas C.M.P." <sistemascmp@redynet4.com.ar> 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

pgsql-odbc by date:

Previous
From: Peter Eisentraut
Date:
Subject: Library names on Unix
Next
From: Ludek Finstrle
Date:
Subject: Re: Table's Field Info