X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 8E6EE11F6278 for ; Thu, 27 Apr 2006 11:32:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 33180-07 for ; Thu, 27 Apr 2006 11:32:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from joyin.redynet.com.ar (smtp.redynet.com.ar [200.69.11.15]) by postgresql.org (Postfix) with SMTP id 8DEC111F60BF for ; Thu, 27 Apr 2006 11:32:26 -0300 (ADT) Received: (qmail 5772 invoked by uid 82); 27 Apr 2006 14:47:21 -0000 Received: from unknown (HELO pcsistemas) (200.69.8.40) by smtp.redynet.com.ar with SMTP; 27 Apr 2006 14:47:21 -0000 Message-ID: <006501c66a07$b8c08d60$0501a8c0@pcsistemas> From: "Sistemas C.M.P." To: Subject: IsDate function in plpgsql Date: Thu, 27 Apr 2006 11:34:42 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0062_01C669EE.9351C3A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/305 X-Sequence-Number: 21474 This is a multi-part message in MIME format. ------=_NextPart_000_0062_01C669EE.9351C3A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable A few days ago, someone in this list gives me a function (plpgsql) that = evaluates if a string is a valid date or not.=20 It returns 1 or 0 (valid/Not Valid) The problem is that if the argument is a NULL field the function returns = 1. I don't have experience with plpgsql language.=20 This is the function begin perform $1::date; return 1; exception when others then return 0; end ------=_NextPart_000_0062_01C669EE.9351C3A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
A few days ago, someone in this=20 list gives  me a function (plpgsql) that evaluates if a string = is a=20 valid date or not.
It returns 1 or 0 (valid/Not = Valid)
The problem is that if the argument is = a NULL field=20 the function returns 1.
I don't have experience with plpgsql = language.=20
This is the function
 
begin
  perform = $1::date;
  return 1;
exception when others then
  = return=20 0;
end
------=_NextPart_000_0062_01C669EE.9351C3A0--