Re: Function testing if a string is a number ?

From: Arnaud Lesauvage <thewild(at)freesurf(dot)fr>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Function testing if a string is a number ?
Date: 2006-02-20 15:14:45
Message-ID: 43F9DCE5.8070103@freesurf.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Tom Lane a écrit :
> Arnaud Lesauvage <thewild(at)freesurf(dot)fr> writes:
>> I am searching for a function that would return true if a string
>> is a number.
>> In Access I would have written IsNumeric('mystring'), but this
>> function does not exist in postgres.
>
> Write your own using a pattern test, for instance
> varchar ~ '^[0-9]+$'
> See
> http://www.postgresql.org/docs/8.1/static/functions-matching.html

Oh yes ! Regular expressions !
I have to think about it now !!!

Thanks a lot Tom !

Regards
--
Arnaud

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Paolo De Simone 2006-02-21 09:41:03 problems to install PostgreSQL
Previous Message Tom Lane 2006-02-20 15:09:46 Re: Function testing if a string is a number ?