Skip to content

Instantly share code, notes, and snippets.

@nofxx
Created September 20, 2010 23:36
Show Gist options
  • Save nofxx/588860 to your computer and use it in GitHub Desktop.
Save nofxx/588860 to your computer and use it in GitHub Desktop.
psql -U postgres
create database template_postgis with template = template1;
UPDATE pg_database SET datistemplate = TRUE where datname = 'template_postgis';
\c template_postgis
CREATE LANGUAGE plpgsql;
# arch
\i /usr/share/postgresql/contrib/postgis-1.5/postgis.sql
\i /usr/share/postgresql/contrib/postgis-1.5/spatial_ref_sys.sql;
# centos x86_64
#\i /usr/share/pgsql/contrib/postgis-1.5/postgis.sql
#\i /usr/share/pgsql/contrib/postgis-1.5/spatial_ref_sys.sql
# debian
#\i /usr/share/postgresql-8.3-postgis/lwpostgis.sql;
#\i /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql;
# osx (brew)
#\i /opt/local/postgis/lwpostgis.sql;
#\i /opt/local/postgis/spatial_ref_sys.sql;
#\i /usr/local/Cellar/postgis/1.4.0/share/postgis/postgis.sql
#\i /usr/local/Cellar/postgis/1.4.0/share/postgis/spatial_ref_sys.sql
GRANT ALL ON geometry_columns TO PUBLIC;
GRANT ALL ON spatial_ref_sys TO PUBLIC;
VACUUM FREEZE;
# Create DB:
# $ createdb -O <owner> -T template_postgis app_development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment