From: Sarah Hoffmann Date: Mon, 2 May 2022 12:12:17 +0000 (+0200) Subject: explicit cast for osm_type parameter in SQL needed X-Git-Tag: v4.1.0~52 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/08672cdf0a9fdad8f765c2fdeb395a370799b25b explicit cast for osm_type parameter in SQL needed Otherwise PostgreSQL won't correctly pick up the index condition. --- 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