Em 6 de outubro de 2010 13:18, Thiago <[email protected]> escreveu: > Pessoal, bom dia. > > Como saber se o conteúdo de uma variável text é um inteiro válido? >
Sim, é só utilizar expressões regulares: bdteste=# SELECT '123'::text !~ '[^[:digit:]]'; ?column? ---------- t (1 row) bdteste=# SELECT '123A'::text !~ '[^[:digit:]]'; ?column? ---------- f (1 row) http://www.postgresql.org/docs/current/interactive/functions-matching.html#FUNCTIONS-POSIX-REGEXP Osvaldo _______________________________________________ pgbr-geral mailing list [email protected] https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
