From 08672cdf0a9fdad8f765c2fdeb395a370799b25b Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 2 May 2022 14:12:17 +0200 Subject: [PATCH] explicit cast for osm_type parameter in SQL needed Otherwise PostgreSQL won't correctly pick up the index condition. --- lib-sql/functions/placex_triggers.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib-sql/functions/placex_triggers.sql b/lib-sql/functions/placex_triggers.sql index 2c1b3bdb..f8580d7f 100644 --- a/lib-sql/functions/placex_triggers.sql +++ b/lib-sql/functions/placex_triggers.sql @@ -120,7 +120,7 @@ BEGIN IF location.members[i+1] = 'street' THEN FOR parent IN SELECT place_id from placex - WHERE osm_type = upper(substring(location.members[i], 1, 1)) + WHERE osm_type = upper(substring(location.members[i], 1, 1))::char(1) and osm_id = substring(location.members[i], 2)::bigint and name is not null and rank_search between 26 and 27 -- 2.39.5