DB Installation - ORGTYTESPOO/kiradigiasm GitHub Wiki

Install PostgreSQL and PostGIS

  • PostgreSQL 9.5
  • PostGIS 2.2.2

Create database

With Finnish encoding:
-- DROP DATABASE "asm-2017-xx-xx";
CREATE DATABASE "asm-2017-xx-xx"
WITH OWNER = [your_admin]
ENCODING = 'UTF8'
TABLESPACE = pg_default
LC_COLLATE = 'fi_FI.UTF-8'
LC_CTYPE = 'fi_FI.UTF-8'
CONNECTION LIMIT = -1;

OR

With English encoding:
-- DROP DATABASE "asm-2017-xx-xx";
CREATE DATABASE "asm-2017-xx-xx"
WITH OWNER = [your_admin]
ENCODING = 'UTF8'
TABLESPACE = pg_default
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
CONNECTION LIMIT = -1;

Create extension postgis

Create a postgis extension for your just created database "asm-2017-xx-xx"
CREATE EXTENSION postgis;

Load SQL

  • Replace [youradmin] with your admin role (e.g. postgres)
  • Run asm.sql
    From command line (e.g. Psql -tool in Windows):
    psql -h hostIP -d asm-2017-xx-xx -U your_admin -p 5432 -a -q -f C:\the_path\asm.sql
    Where:
    -h PostgreSQL server IP address
    -d name of the asm database and version
    -U your admin user name
    -p port which PostgreSQL server is listening on
    -a all echo
    -q quiet
    -f path to SQL script

UML (click image)