Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.
createdb mydb -T template_postgis

Is this -T template_postgis still necessary in new versions of PostGIS?

I never saw this db being different, it always has those 3 sql files you run there. Is this still necessary?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

You no longer need to use the templates or even the script in the new versions of Postgis. As you can see in the Postgis - installation page, all you need is run the CREATE EXTENTION command.

-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
-- Enable Topology
CREATE EXTENSION postgis_topology;
-- fuzzy matching needed for Tiger
CREATE EXTENSION fuzzystrmatch;
-- Enable US Tiger Geocoder
CREATE EXTENSION postgis_tiger_geocoder;
share|improve this answer

I never use it, simply create a new DB from basic Postgresql template:

CREATE DATABASE pgis_template TEMPLATE template0;

Then i load and run scripts postgis.sql and spatial_ref_sys.sql for your basic setup. I then use this template DB for all the others i create

share|improve this answer
    
you do the same as I. then you use create database newdb template=pgis_template. Just as I do this from system shell: createdb newdb -T pgis_template. Same thing. –  culebrón Apr 13 at 20:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.