Josué Maldonado <josue(at)lamundial(dot)hn> writes:
> Hello list,
>
> That's my question, I can't figure out a way to know if a given string is
> digit, soemthing like this:
>
>
> ISDIGIT("ARWA") = False
> ISDIGIT("5334") = True
>
> If anyone know a way to get that done, I'll appreciate the help.
create function isdigit(text) returns boolean as '
select $1 ~ ''^(-)?[0-9]+$'' as result
' language sql;
masm=# select isdigit('ARWA');
isdigit
---------
f
(1 row)
masm=# select isdigit('5334');
isdigit
---------
t
(1 row)
Regards,
Manuel.