This script creates the database structure, unpacks the files automatically and then inserts them into the database.
In the end, the script compares the rows in the database and in the csv files, to make sure all rows got inserted.
The script assumes, that the database used is named patstat and owned by a user named patstat. It is tested with postgres 13 and the PATSTAT 2021 Autumn edition
- connection parameters are hardcoded