# 1. Run `./import.sh -g` from `geonames_pg_import` to download the geonames data
# cd ../../geonames/geonames_pg_import
./import.sh -g
# 2. Create raw tables
./sqitch deploy 2_add_tables
# 3. Run `./import.sh -i` from `geonames_pg_import`
# cd ../../geonames/geonames_pg_import
./import.sh -i
# ./sqitch deploy 10_add_admin2_idx
./sqitch deploy- https://www.postgresql.org/docs/current/libpq-pgpass.html
- https://tableplus.com/blog/2019/09/how-to-use-pgpass-in-postgresql.html
echo "localhost:5432:mydb:myuser:mypassword" >> ~/.pgpass
chmod 0600 ~/.pgpasssqitch add appschema -n 'Add schema for all flipr objects.'
- https://github.com/sqitchers/sqitch/blob/develop/lib/sqitch-passwords.pod
- https://metacpan.org/pod/sqitch-authentication
- https://github.com/cioionut/geonames_pg_import
- https://event.ifi.uni-heidelberg.de/wp-content/uploads/2017/03/geonames_installation.pdf
- https://github.com/swidz/GeoNames-PostgreSQL-DataImport
sqitch deploy table_constraints
SELECT distinct g.admin1 FROM public.geoname g
left join public.admin1_codes ac on g.country || '.' || g.admin1 = ac.code
where
country = 'GB' and (g.admin1 != '00') and ac.code is NULL