]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-sql/functions/place_triggers.sql
Use place instead of placex to compute postcodes
[nominatim.git] / lib-sql / functions / place_triggers.sql
index 5316374648ff5c5e6ac4ae56b081430319506cac..c19b22747f5fc6882b03a33a4f40fbe89469e56e 100644 (file)
@@ -77,6 +77,12 @@ BEGIN
 
   ELSE -- insert to placex
 
+    -- Pure postcodes are never queried from placex so we don't add them.
+    -- location_postcodes is filled from the place table directly.
+    IF NEW.class = 'place' AND NEW.type = 'postcode' THEN
+      RETURN NEW;
+    END IF;
+
     -- Patch in additional country names
     IF NEW.admin_level = 2 AND NEW.type = 'administrative'
           AND NEW.address is not NULL AND NEW.address ? 'country' THEN