restrict deferred delete to concerned place

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.
This commit is contained in:
Sarah Hoffmann 2012-03-09 23:47:25 +01:00
parent a517dd0ccf
commit 44f5058deb

View 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;