From 8433a95f2d3529554d2e9f07528326112469c374 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 11 Apr 2022 10:11:13 +0100 Subject: [PATCH] turn select statement to insert --- etl/update_building_records.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etl/update_building_records.sh b/etl/update_building_records.sh index be92ca03..96753396 100644 --- a/etl/update_building_records.sh +++ b/etl/update_building_records.sh @@ -18,9 +18,10 @@ # geometry_id serial PRIMARY KEY, # source_id varchar(30) # );" -psql -c "SELECT geometry_id, source_id - FROM geometries - WHERE source_id NOT IN ( SELECT ref_toid FROM buildings);" +psql -c "INSERT INTO new_geometries ( geometry_id, source_id ) + SELECT geometry_id, source_id + FROM geometries + WHERE source_id NOT IN ( SELECT ref_toid FROM buildings);" # for building in buildings