Friday, 24 August 2018

postgresql - Why does PostGIS installation not create a template_postgis?


I went this route for installation of PostgreSQL and PostGIS:



Now when I launch pgAdmin and try to create a new PostGIS database, there is no template_postgis for use in Template.




I have tried going another route, that is downloading the PostgreSQL package directly from PostgreSQL. This installs the server and allows you to use the StackBuilder to download and install PostGIS. This doesn't fix my problem.



Answer



You can quite easily create the template if it is not there automatically. Here is a description for ubuntu: http://obsessivecoder.com/2010/02/01/installing-postgresql-8-4-postgis-1-4-1-and-pgrouting-1-0-3-on-ubuntu-9-10-karmic-koala/


This is the essential part:



sudo su postgres
createdb template_postgis
createlang plpgsql template_postgis
psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis.sql
psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql

In Precise Pangolin:


sudo su postgres
createdb template_postgis
psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql

psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...