fellix / siga forked from fireho/siga

Sistema de Gestão Administrativa

siga / INSTALL.rdoc
100644 53 lines (33 sloc) 1.16 kb

PostgreSQL

UTF Database:

    export PGROOT="/var/lib/postgres"
    mkdir -p $PGROOT/data && chown postgres.postgres $PGROOT/data
    su - postgres -c "/usr/bin/initdb -E utf8 --locale=en_US.UTF-8 $PGROOT/data"

PostGIS

Installing PostGIS extensions on PostgreSQL:

  su postgres
  psql template1

  create database template_postgis with template = template1;
  UPDATE pg_database SET datistemplate = TRUE where datname = 'template_postgis';
  \c template_postgis
  CREATE LANGUAGE plpgsql;

Distro specific:

  # archlinux
  \i /usr/share/lwpostgis.sql;
  \i /usr/share/spatial_ref_sys.sql;

  # centos x86_64
  \i /usr/share/pgsql/contrib/lwpostgis-64.sql
  \i /usr/share/pgsql/contrib/spatial_ref_sys.sql

  # debian
  \i /usr/share/postgresql-8.3-postgis/lwpostgis.sql;
  \i /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql;

  # osx
  \i /opt/local/postgis/lwpostgis.sql;
  \i /opt/local/postgis/spatial_ref_sys.sql;

Finalize:

  GRANT ALL ON geometry_columns TO PUBLIC;
  GRANT ALL ON spatial_ref_sys TO PUBLIC;

  VACUUM FREEZE;

DATABASE

  $ createdb -O <owner> -T template_postgis siga_development

Repeat for test and production.