]> git.openstreetmap.org Git - nominatim.git/commitdiff
restrict deferred delete to concerned place
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 9 Mar 2012 22:47:25 +0000 (23:47 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 9 Mar 2012 22:47:25 +0000 (23:47 +0100)
Deleting by osm_type/osm_id goes wrong if the place was reimported
because of a change in geometry, admin_level etc. The newly created
place is deleted as well in this case.

sql/functions.sql

index af9c47bbdcce5ed5fa555167f8f53143a01fff4d..1f7586facaadd808745d342a054e2fb1cc056941 100644 (file)
@@ -1217,9 +1217,9 @@ BEGIN
     RETURN NEW;
   END IF;
 
-  -- defered delete
+  -- deferred delete
   IF OLD.indexed_status = 100 THEN
-    delete from placex where osm_type = OLD.osm_type and osm_id = OLD.osm_id and class = OLD.class and type = OLD.type;
+    delete from placex where place_id = OLD.place_id;
     RETURN NULL;
   END IF;