X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9000ED1B4E3 for ; Thu, 16 Oct 2003 12:51:02 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 98013-02 for ; Thu, 16 Oct 2003 09:50:34 -0300 (ADT) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by svr1.postgresql.org (Postfix) with ESMTP id B4F44D1B500 for ; Thu, 16 Oct 2003 09:50:30 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-30.mail.demon.net with esmtp (Exim 3.35 #1) id 1AA7aC-000IIt-0U; Thu, 16 Oct 2003 13:50:24 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 45AFA17E79; Thu, 16 Oct 2003 13:50:21 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 991C116AB0; Thu, 16 Oct 2003 13:50:20 +0100 (BST) From: Richard Huxton To: "Zhao, Scott" , pgsql-sql@postgresql.org Subject: Re: SQL function to validate money input Date: Thu, 16 Oct 2003 13:50:21 +0100 User-Agent: KMail/1.5 References: <8A45A0F766A7C34894C80BBAEBEBA118E0AC7E@thick.usask.ca> In-Reply-To: <8A45A0F766A7C34894C80BBAEBEBA118E0AC7E@thick.usask.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310161350.21534.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/187 X-Sequence-Number: 15587 On Wednesday 15 October 2003 22:46, Zhao, Scott wrote: > Hi All, > > Is there a function available to validate if the input is a correct > money format? For exapmle, "23.56" is a correct number but "23.567" is > incorrect. I just like to do this in postgres level not in my > application code. Well, you can always write your own, but: 1. How were you planning to use it? 2. What were you planning to do if the value provided isn't valid as money? -- Richard Huxton Archonet Ltd