There are currently a few different methods to spatially enable a PostgreSQL database with PostGIS:
- Using the DDL command
CREATE EXTENSION postgis;
. Easiest and recommended. - Using enabler scripts. This method has multiple steps, is useful if you have specific requirements, for example disallowing raster support.
- Using a template (e.g.
template_postgis
) database. This could be useful to setup multiple databases that have similar features. Sometimestemplate_postgis
is pre-installed, other times you would need to create this.