2008/1/22 Leonardo Cezar <[EMAIL PROTECTED]>:
> 2008/1/22 Anderson <[EMAIL PROTECTED]>:
>
> > Gostaria de saber se existe alguma funcao no PostgreSQL que retorna se uma
> > determinada string so possui valor numerico.
> >
> > exemplo:
> >
> > '123' == verdadeiro
> > '123a' == falso
>
> SELECT '123' ~ '^[-0-9]+$'

fix (numeros negativos):

SELECT '123' ~ '^(\\-|\\+)?\\d+$'

-Leo
-- 
Leonardo Cezar et all
http://www.dextra.com.br/postgres
http://www.postgresql.org.br
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a