pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sistemas C.M.P. <sistemascmp@redynet4.com.ar>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Function Like IsDate in pgSQL
Date: Mon, 02 Jan 2006 13:05:15 -0500
Message-ID: <7391.1136225115@sss.pgh.pa.us> (raw)
In-Reply-To: <002001c60fb0$5902bc10$1601a8c0@pcsistemas>
References: <002001c60fb0$5902bc10$1601a8c0@pcsistemas>

"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



view thread (2+ messages)

Message-ID: <7391.1136225115@sss.pgh.pa.us>
Permalink:  ../7391.1136225115@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7391.1136225115@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sistemascmp@redynet4.com.ar
  Subject: Re: Function Like IsDate in pgSQL
  In-Reply-To: <7391.1136225115@sss.pgh.pa.us>
  References: <002001c60fb0$5902bc10$1601a8c0@pcsistemas> <7391.1136225115@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox