Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6DHXKa72146 for ; Fri, 13 Jul 2001 13:33:20 -0400 (EDT) (envelope-from dev@archonet.com) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-34.mail.demon.net with esmtp (Exim 2.12 #1) id 15L6oY-000K78-0Y; Fri, 13 Jul 2001 18:33:19 +0100 Received: from client (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with SMTP id 7C5B813B76; Fri, 13 Jul 2001 18:04:55 +0100 (BST) Message-ID: <006401c10bbd$effc5320$1001a8c0@archonet.com> From: "Richard Huxton" To: "Josh Berkus" , References: Subject: Re: Date Validation? Date: Fri, 13 Jul 2001 18:04:52 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200107/177 X-Sequence-Number: 3969 From: "Josh Berkus" > Folks, > > Pardon me for asking this again, but I received *no* responses last > week. > > Question: Is there any function or method which will allow me, in SQL > or PL/pgSQL, to validate dates without raising an error for invalid > dates? > > Expansion: I have a number of PL/pgSQL functions which must accept > dates as parameters from the PHP4 interface. There is, however, the > possibility that an invalid date will be passed, such as "2001-02-31" > due to the nature of HTML forms date selector. Out of curiosity Josh, why aren't you validating in PHP? - only takes a couple of lines there. - Richard Huxton