select statement for geometries not in builings

This commit is contained in:
Ed Chalstrey 2022-04-11 10:03:43 +01:00
parent 2c6051682b
commit d930ae3a75

View File

@ -18,13 +18,9 @@
# geometry_id serial PRIMARY KEY,
# source_id varchar(30)
# );"
psql -c "WITH new_geometries AS (
INSERT INTO buildings ( geometry_id, ref_toid )
SELECT geometry_id, source_id
FROM geometries
ON CONFLICT ( ref_toid )
DO NOTHING RETURNING *
);"
psql -c "SELECT geometry_id, source_id
FROM geometries
WHERE source_id NOT IN ( SELECT ref_toid FROM buildings);"
# for building in buildings