Open Infrastructure Map, a view of infrastructure data in OpenStreetMap
Limit the text length of integers we attempt to convert
Russ Garrett47bbb12eae88
diff --git a/schema/functions.sql b/schema/functions.sqlindex fbe7133..58e2569 100644--- a/schema/functions.sql+++ b/schema/functions.sql@@ -75,6 +75,7 @@ END$$ LANGUAGE plpgsql;-- Convert a text integer value into an integer.+-- Only supports 9-decimal-digit positive integersCREATE OR REPLACE FUNCTION convert_integer(value TEXT) RETURNS INTEGERIMMUTABLEPARALLEL SAFE@@ -83,7 +84,7 @@ AS $$DECLAREparts TEXT[];BEGIN- parts := regexp_matches(value, '^([0-9]+)$', '');+ parts := regexp_matches(value, '^([0-9]{1,9})$', '');RETURN parts[1];END$$ LANGUAGE plpgsql;