Before adding PostGIS extension to Postgres. You first need to install PostGIS on Ubuntu 14.
04
Add PPA from terminal
$ sudo add-apt-repository ppa:ubuntugis/ppa
$ sudo apt-get update
Install PostGIS with apt-get
$ sudo apt-get install postgis
After successful installation open psql
$ sudo -u postgres psql
List all databases
postgres=# \l
Connect to specific database
postgres=# \c DATABASE_NAME
Run the following to add PostGIS extension to Postgres
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
Exit from psql
postgres=# \q
Thank you
Logs
Connecting: host=localhost port=5432 user=postgres password='********' dbname=postgis_4g_tdd
client_encoding=UTF8
Connection succeeded.
Connecting: host=localhost port=5432 user=postgres password='********' dbname=postgis_4g_tdd
client_encoding=UTF8
==============================
Importing with configuration: couverture_4g_tdd_outdoor_100, public, geom, C:\Users\mma\
Documents\Projet_TDD\4G TDD\Couverture_4G_TDD_outdoor_100.shp, mode=c, dump=1,
simple=0, geography=0, index=1, shape=1, srid=0
Shapefile type: Polygon
PostGIS type: MULTIPOLYGON[2]
COPY failed with the following error: ERREUR: syntaxe en entrée invalide pour l'entier : « -100.00000
»
CONTEXT: COPY couverture_4g_tdd_outdoor_100, ligne 1, colonne threshold : « -100.00000 »
Shapefile import failed.
CREATE DATABASE postgis_4g_tdd
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default
LC_COLLATE = 'French_France.1252'
LC_CTYPE = 'French_France.1252'
CONNECTION LIMIT = -1;
ALTER DATABASE postgis_4g_tdd
SET search_path = "$user", public, topology, tiger;