colouring-montreal/maintenance/extract_data/export_uprns.sql
Tom Russell 0a86566821 Use Postgres COPY to extract data
- COPY typically runs faster than going via Python
- properly formatted JSON in edit history patches
- assumes postgres and maintenance user both have
  access to /tmp
2019-10-02 15:03:54 +01:00

9 lines
160 B
SQL

COPY(SELECT
building_id,
uprn,
parent_uprn
FROM building_properties
WHERE building_id IS NOT NULL)
TO '/tmp/building_uprns.csv'
WITH CSV HEADER