Add missing isnumeric function migration.

This commit is contained in:
Syfaro 2021-08-22 01:22:46 -04:00
parent 914a9b24ba
commit 9255a49fb5
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1 @@
DROP FUNCTION IF EXISTS isnumeric;

View File

@ -0,0 +1,11 @@
CREATE OR REPLACE FUNCTION isnumeric(text) RETURNS BOOLEAN AS $$
DECLARE x NUMERIC;
BEGIN
x = $1::NUMERIC;
RETURN TRUE;
EXCEPTION WHEN others THEN
RETURN FALSE;
END;
$$
STRICT
LANGUAGE plpgsql IMMUTABLE;