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