mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
don't delete names on unknown country boundaries
If a country boundary has a country_code that is unknown to Nominatim, it would delete all names because the coalascing with country_name would not yield any result.
This commit is contained in:
@@ -1988,7 +1988,10 @@ BEGIN
|
||||
|
||||
-- Patch in additional country names
|
||||
IF NEW.admin_level = 2 AND NEW.type = 'administrative' AND NEW.country_code is not null THEN
|
||||
select coalesce(country_name.name || NEW.name,NEW.name) from country_name where country_name.country_code = lower(NEW.country_code) INTO NEW.name;
|
||||
SELECT name FROM country_name WHERE country_code = lower(NEW.country_code) INTO existing;
|
||||
IF existing.name IS NOT NULL THEN
|
||||
NEW.name = existing.name || NEW.name;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
-- Have we already done this place?
|
||||
|
||||
Reference in New Issue
Block a user