Skip to content

Instantly share code, notes, and snippets.

@rmamba
Created November 6, 2014 20:17
Show Gist options
  • Save rmamba/08c677c09fdcd36cc6bd to your computer and use it in GitHub Desktop.
Save rmamba/08c677c09fdcd36cc6bd to your computer and use it in GitHub Desktop.
Generate empty PostGres DB for OSM
SET pgpass=secret
SET pguser=postgres
DROPDB -U postgres -h localhost planetosm
CREATEDB -U postgres -h localhost -T template_postgis -e -O postgres planetosm
psql -h localhost -t -d planetosm -U postgres -a -c "CREATE SCHEMA markware;"
psql -h localhost -t -d planetosm -U postgres -a -c "ALTER DATABASE planetosm SET search_path='markware','public';"
psql -h localhost -t -d planetosm -U postgres -a -c "GRANT ALL PRIVILEGES ON DATABASE planetosm to osm;"
psql -h localhost -t -d planetosm -U postgres -a -c "CREATE EXTENSION hstore;"
psql -h localhost -U postgres -f /home/osm900913.sql planetosm
VACUUMDB -h localhost -U postgres -d planetosm -z -e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment