Re: Function Like IsDate in pgSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Sistemas C(dot)M(dot)P(dot)" <sistemascmp(at)redynet4(dot)com(dot)ar>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Function Like IsDate in pgSQL
Date: 2006-01-02 18:05:15
Message-ID: 7391.1136225115@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

"Sistemas C.M.P." <sistemascmp(at)redynet4(dot)com(dot)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

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message noreply 2006-01-02 19:03:51 [ psqlodbc-Bugs-1000510 ] Access the rdoResultsets column is NULL in the second access
Previous Message Peter Eisentraut 2006-01-02 16:29:30 Library names on Unix