Re: Isnumeric function? - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Isnumeric function?
Date
Msg-id 200409080947.17682.josh@agliodbs.com
Whole thread Raw
In response to Re: Isnumeric function?  (Oliver Elphick <olly@lfix.co.uk>)
Responses Re: Isnumeric function?  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-sql
Oliver, Theo:

>  ~ '^[0-9]+$'

Actually, I usually do:

~ '^[0-9]+\.?[0-9]*$'

... to include decimals.   However, the above assumes that there is at least a 
"0" before the decimal; it would be nice to adapt it to matching a leading 
decimal (i.e. .057 ) as well.   Can't see any easy way, though ...

-- 
Josh Berkus
Aglio Database Solutions
San Francisco


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Problem with returning setof record
Next
From: Josh Berkus
Date:
Subject: Re: How to rename a constraint/trigger??