SET search_path=revision,public;

CREATE UNLOGGED TABLE tmp AS (SELECT * FROM object_revision_with_geometry WHERE attributes_id IN
 (SELECT id FROM attributes WHERE contents ?| array['cat:transport_metro_line','cat:transport_railway','cat:transport_tram_route','cat:transport_waterway_route','cat:vegetation','cat:hydro','cat:urban','cat:urban_roadnet','cat:urban_roadnet_pass','cat:relief','cat:landmark']) );

UPDATE tmp SET geometry_id=0;

DELETE FROM object_revision_with_geometry WHERE attributes_id IN
 (SELECT id FROM attributes WHERE contents ?| array['cat:transport_metro_line','cat:transport_railway','cat:transport_tram_route','cat:transport_waterway_route','cat:vegetation','cat:hydro','cat:urban','cat:urban_roadnet','cat:urban_roadnet_pass','cat:relief','cat:landmark']);

INSERT INTO object_revision_without_geometry SELECT * FROM tmp;

DROP TABLE tmp;

SET search_path=public;

