Skip to content

cioionut/geonames-postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How do deploy

  1. Run ./import.sh -g from geonames_pg_import to download the geonames data
  2. sqitch deploy 2_add_tables
  3. Run ./import.sh -i from geonames_pg_import
  4. sqitch deploy 7_add_country_fk

Setup .pgpass file

echo "localhost:5432:mydb:myuser:mypassword" >> ~/.pgpass
chmod 0600 ~/.pgpass

Sqitch

Install Sqitch

Sqitch Commands

sqitch add appschema -n 'Add schema for all flipr objects.'

Manage Secrets

Postgres Tutorial

Inspiration

Disk Usage

sqitch commands

  • sqitch deploy table_constraints

DEBUG

Spot not present foreign key in the admin1_codes table

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

About

Load geonames dumps in Postgres using sqitch as database change management tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors