Re: Isnumeric function? - Mailing list pgsql-sql

From Oliver Elphick
Subject Re: Isnumeric function?
Date
Msg-id 1094537126.6360.279.camel@linda
Whole thread Raw
In response to Isnumeric function?  (Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>)
Responses Re: Isnumeric function?
List pgsql-sql
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 
 




pgsql-sql by date:

Previous
From: Theo Galanakis
Date:
Subject: Isnumeric function?
Next
From: Andreas Joseph Krogh
Date:
Subject: Problem with LATIN1 characters from Perl-DBI