Forked from hschnegg/PostgreSQL test if text can be cast to numeric
Created
June 23, 2022 11:47
-
-
Save ApOgEE/51f5ce45380bc36b091631a3fcb94a06 to your computer and use it in GitHub Desktop.
PostgreSQL: Test if text can be cast to numeric
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select (mytext ~ '^([0-9]+[.]?[0-9]*|[.][0-9]+)$'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment