Skip to content
a-d edited this page Mar 3, 2014 · 1 revision

You can setup a valid PostgreSQL environment including PostGIS by following the two steps:

  1. Visit the PostgreSQL website and download the current version. (e.g. 9.3)

  2. Visit the PostGIS website and download the current version. (e.g. 2.1)

If you are running a Debian system, we recommend installing a precompiled version. In that case, please follow the official instructions to do so. As soon as you registered the postgres related APT pgdg repository, you can run the following command: # apt-get install postgresql-server-dev-9.3 postgresql-9.3-postgis-2.1

If you are running a Windows system and you are asked to whether or not insall plugins, during the installation process; feel free to install the delivered PostGIS plugin. It may not be the newest version, but it will suffice.

Importing the Database

  1. To import the database, you need to first create a database:

    $ createdb spatial_election --encoding UNICODE --template=template0
    $ psql spatial_election
    > CREATE EXTENSION postgis;
    > CREATE EXTENSION postgis_topology;
    > \q
    
  2. Then you need to restore the database dump file to your database. You need to dowmload the spatial_db.backup file. pg_restore -d spatial_election spatial_db.backup

  3. Create a role with password according to your hibernate.cfg.xml

Clone this wiki locally