X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/130f904b90dd8508a210c89f2f2cd76056adc397..62dbbbede6ac6b75d0bd75a0d21016bcdfc61742:/sql/functions.sql?ds=sidebyside

diff --git a/sql/functions.sql b/sql/functions.sql
index 820bdbf8..97baf52b 100644
--- a/sql/functions.sql
+++ b/sql/functions.sql
@@ -1757,7 +1757,7 @@ BEGIN
   END IF;
 
   -- make sure all names are in the word table
-  IF NEW.admin_level = 2 AND NEW.class = 'boundary' AND NEW.type = 'administrative' AND NEW.country_code IS NOT NULL THEN
+  IF NEW.admin_level = 2 AND NEW.class = 'boundary' AND NEW.type = 'administrative' AND NEW.country_code IS NOT NULL AND NEW.osm_type = 'R' THEN
     perform create_country(NEW.name, lower(NEW.country_code));
     --DEBUG: RAISE WARNING 'Country names updated';
   END IF;
