- FOR location IN SELECT * FROM placex WHERE osm_type = 'W' and osm_id = relation.parts[i] and class = NEW.class and type = NEW.type
+ FOR location IN SELECT * FROM placex WHERE osm_type = 'W' and osm_id = substring(relation.members[i],2,200)::bigint and class = NEW.class and type = NEW.type
LOOP
UPDATE placex SET linked_place_id = NEW.place_id WHERE place_id = location.place_id;
END LOOP;
LOOP
UPDATE placex SET linked_place_id = NEW.place_id WHERE place_id = location.place_id;