is_numeric() or extract_numeric() functions?

Поиск
Список
Период
Сортировка
От Ron St.Pierre
Тема is_numeric() or extract_numeric() functions?
Дата
Msg-id QTDZ9.134900$Yo4.6428311@news1.calgary.shaw.ca
обсуждение исходный текст
Ответы Re: is_numeric() or extract_numeric() functions?  ("Rod Kreisler" <rod@23net.net>)
Re: is_numeric() or extract_numeric() functions?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I can't find an is_numeric() or extract_numeric() function in postgres
so I decided I would make my own. However, when I try to create the
following function:


CREATE OR REPLACE FUNCTION getnumber(varchar(1)) RETURNS integer AS '
        BEGIN
            return ($1 ~ '[0-9]');
        END;
' LANGUAGE 'plpgsql';


I get the following error:

  parse error at or near "["


Anyone know how to fix this, or if there is an is_numeric() or
extract_numeric() function available?

Thanks

--
Ron St.Pierre
Syscor R&D
tel: 250-361-1681
email: rstpierre@syscor.com


В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Welty
Дата:
Сообщение: Re: Using RSYNC for replication?
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: If you are trying to unsubscribe, please READ THIS