PostgreSQL isNumeric() ?

Here’s a very simple way you can check if a bunch of text is numeric.

select (’9339′ ~ ‘^[0-9]+$’);
select (’93a39′ ~ ‘^[0-9]+$’);

The first should return true, the second false.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s