X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B0CA75E4741 for ; Tue, 7 Sep 2004 07:05:36 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56260-01 for ; Tue, 7 Sep 2004 06:05:32 +0000 (GMT) Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by svr1.postgresql.org (Postfix) with ESMTP id A01FE5E474E for ; Tue, 7 Sep 2004 07:05:30 +0100 (BST) Received: from lfix.demon.co.uk ([80.177.205.209] helo=cerberus.lfix.co.uk) by anchor-post-34.mail.demon.net with esmtp (Exim 3.35 #1) id 1C4Z6h-0006HD-0Y; Tue, 07 Sep 2004 06:05:31 +0000 Received: from linda.lfix.co.uk ([192.168.1.1]) by cerberus.lfix.co.uk with esmtp (Exim 4.34) id 1C4Z6d-0002Yr-0O; Tue, 07 Sep 2004 07:05:27 +0100 Subject: Re: Isnumeric function? From: Oliver Elphick Reply-To: olly@lfix.co.uk To: Theo Galanakis Cc: pgsql-sql@postgresql.org In-Reply-To: <82E30406384FFB44AFD1012BAB230B55037D056E@shiva.au.lpint.net> References: <82E30406384FFB44AFD1012BAB230B55037D056E@shiva.au.lpint.net> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1094537126.6360.279.camel@linda> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 07 Sep 2004 07:05:26 +0100 Content-Transfer-Encoding: 7bit X-LFIX-MailScanner: Found to be clean X-MailScanner-From: olly@lfix.co.uk X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/41 X-Sequence-Number: 18887 On Tue, 2004-09-07 at 06:44, Theo Galanakis wrote: > How could you determine if a value being inserted into a varchar > column is numeric? > > I was thinking of using a Regular expression to find this, something > like > > .. Where content ~* '^[0-9]{1,10}' ~ '^[0-9]+$' Your version only checks the beginning of the string. > There must be an easier way like a isNumeric() function? Not that I know of. -- Oliver Elphick olly@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA ======================================== "For whosoever shall call upon the name of the Lord shall be saved." Romans 10:13