Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
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
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)
-- 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 '14 at 20:49

Your Answer


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.