Re: Function testing if a string is a number ? - Mailing list pgsql-novice

From Tom Lane
Subject Re: Function testing if a string is a number ?
Date
Msg-id 26030.1140448186@sss.pgh.pa.us
Whole thread Raw
In response to Function testing if a string is a number ?  (Arnaud Lesauvage <thewild@freesurf.fr>)
Responses Re: Function testing if a string is a number ?
List pgsql-novice
Arnaud Lesauvage <thewild@freesurf.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

            regards, tom lane

pgsql-novice by date:

Previous
From: Arnaud Lesauvage
Date:
Subject: Function testing if a string is a number ?
Next
From: Arnaud Lesauvage
Date:
Subject: Re: Function testing if a string is a number ?