Open Infrastructure Map, a view of infrastructure data in OpenStreetMap
Make voltage conversion stricter
Russ Garrett7d9e7d701aa0
diff --git a/schema/functions.sql b/schema/functions.sqlindex 4ecd957..fbe7133 100644--- a/schema/functions.sql+++ b/schema/functions.sql@@ -74,8 +74,7 @@ BEGINEND$$ LANGUAGE plpgsql;--- Convert a text integer value into an integer--- Trailing text is discarded. Leading text, or any other invalid value, results in a NULL.+-- Convert a text integer value into an integer.CREATE OR REPLACE FUNCTION convert_integer(value TEXT) RETURNS INTEGERIMMUTABLEPARALLEL SAFE@@ -84,7 +83,7 @@ AS $$DECLAREparts TEXT[];BEGIN- parts := regexp_matches(value, '^([0-9]+)', '');+ parts := regexp_matches(value, '^([0-9]+)$', '');RETURN parts[1];END$$ LANGUAGE plpgsql;