2014-11-15 23:32:19 +08:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Init script for template postgis
|
|
|
|
#
|
|
|
|
|
2017-04-04 04:46:52 +08:00
|
|
|
POSTGIS_SQL_PATH=`pg_config --sharedir`/contrib/postgis-2.2;
|
2014-11-15 23:32:19 +08:00
|
|
|
createdb -E UTF8 template_postgis;
|
|
|
|
createlang -d template_postgis plpgsql;
|
|
|
|
psql -d postgres -c "UPDATE pg_database SET datistemplate='true' \
|
|
|
|
WHERE datname='template_postgis'"
|
|
|
|
psql -d template_postgis -c "CREATE EXTENSION postgis;"
|
|
|
|
psql -d template_postgis -c "CREATE EXTENSION postgis_topology;"
|
|
|
|
psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;"
|
|
|
|
psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"
|
|
|
|
psql -c "CREATE EXTENSION plpythonu;"
|
2017-04-05 03:13:53 +08:00
|
|
|
psql -d template_postgis -c "CREATE EXTENSION plpythonu;"
|
|
|
|
psql -d template_postgis -c "CREATE EXTENSION crankshaft VERSION 'dev';"
|
2017-04-07 04:24:10 +08:00
|
|
|
psql -d template_postgis -c "CREATE EXTENSION plproxy;"
|