Created
March 13, 2012 14:24
-
-
Save boundsj/2029093 to your computer and use it in GitHub Desktop.
Create the postgis template on a mac that had postgis installed from brew
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# path taken from brew install notes | |
POSTGIS_SQL_PATH=/usr/local/share/postgis | |
# Creating the template spatial database. | |
createdb -E UTF8 template_postgis | |
createlang -d template_postgis plpgsql # Adding PLPGSQL language support. | |
# Allows non-superusers the ability to create from this template | |
psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';" | |
# Loading the PostGIS SQL routines | |
psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql | |
psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql | |
# Enabling users to alter spatial tables. | |
psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;" | |
psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;" | |
psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment