Postgre install

Installation de postgreSQL
En administrateur : apt-get install postgresql-9.4 postgresql-client-9.4 postgresql-9.4-postgis-2.1 postgresql-9.4-postgis-2.1-scripts

sudo vim /etc/postgresql/9.4/main/postgresql.conf

Port = 7000

Sudo service postgresql restart

sudo -u postgres psql

postgres=# alter user postgres password ;

postgres=# CREATE USER cbc_user WITH PASSWORD ;

postgres=# CREATE DATABASE ;

postgres=# GRANT ALL PRIVILEGES ON DATABASE cbc to cbc_user;

sudo -u postgres psql cbc

cbc=# CREATE EXTENSION postgis

sudo su - postgres

psql cbc

cbc=# CREATE SCHEMA montpellier;

cbc=# GRANT ALL ON SCHEMA montpellier TO cbc_user;

shp2pgsql -s 2154 -g geom -S -W "latin1" -p BATIMENT_area_polygon.shp montpellier.area_polygon | psql -U cbc_user -d cbc -h localhost -p 7000