Final steps installing PostGIS on Ubuntu

You have installed the PostgreSQL and PostGIS pacakges that Ubuntu easely provides but... you are unable to create your GIS database. Maybe you need the next:

# log in to the database template1:
psql template1

# issue command to create new database:
create database template_postgis with template = template1;

# update pg_database table to indicate that new database is a template
UPDATE pg_database SET datistemplate = TRUE where datname = 'template_postgis';

# connect to new database
\c template_postgis

# add PostGIS extensions and grant access to everyone to spatial tables.
CREATE LANGUAGE plpgsql ;
\i /usr/share/postgresql-8.3-postgis/lwpostgis.sql;
\i /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql;
GRANT ALL ON geometry_columns TO PUBLIC;
GRANT ALL ON spatial_ref_sys TO PUBLIC;

# prevent further changes to this database
VACUUM FREEZE;

Via: http://blog.ralreegorganon.com

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.