Installing postgis 2.x as extension on Ubuntu 12.04 LTSInstallare postgis 2.x come estensione su Ubuntu 12.04 LTS

This is the procedure that I follow to implement postgis (vers.2.0) as extension:

  1. Installation of the  postgis 2.x packages  from the Ubuntu official repository;
  2. creation of a new fresh postgreSQL database “mydb” without any postgis function;
  3. creation  of the extension with pgAdminIII:
CREATE EXTENSION "postgis";
CREATE EXTENSION "postgis_topology";
CREATE SCHEMA postgis;
ALTER DATABASE mydb SET search_path="$user", public, postgis,topology;
GRANT ALL ON SCHEMA postgis TO public;
ALTER EXTENSION postgis SET SCHEMA postgis;

Questa è la procedura che ho seguito per implementare postgis (vers.2.0) come estensione:

  1. installazione del pacchetto postgis 2.x dal repository uffciale di Ubuntu;
  2. creazione di un nuovo database postgreSQL “mydb” senza installare nessuna funzione postgis;
  3. creazione dell’estensione attraverso i seguenti comandi eseguiti con pgadminIII:
CREATE EXTENSION "postgis";
CREATE EXTENSION "postgis_topology";
CREATE SCHEMA postgis;
ALTER DATABASE mydb SET search_path="$user", public, postgis,topology;
GRANT ALL ON SCHEMA postgis TO public;
ALTER EXTENSION postgis SET SCHEMA postgis;