Re: Function testing if a string is a number ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Function testing if a string is a number ?
Дата
Msg-id 26030.1140448186@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Function testing if a string is a number ?  (Arnaud Lesauvage <thewild@freesurf.fr>)
Ответы Re: Function testing if a string is a number ?  (Arnaud Lesauvage <thewild@freesurf.fr>)
Список 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 по дате отправления:

Предыдущее
От: Arnaud Lesauvage
Дата:
Сообщение: Function testing if a string is a number ?
Следующее
От: Arnaud Lesauvage
Дата:
Сообщение: Re: Function testing if a string is a number ?