File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,17 @@ docker run --name postgresql -itd \
200200 sameersbn/postgresql:9.4-11
201201```
202202
203+ Additionally, creation of PostGIS topology extension can be enabled by specifying ` DB_POSTGIS_TOPOLOGY=true ` :
204+
205+
206+ ``` bash
207+ docker run --name postgresql -itd \
208+ --env ' DB_NAME=dbname' --env ' DB_POSTGIS=true' --env DB_POSTGIS_TOPOLOGY=true \
209+ sameersbn/postgresql:9.4-11
210+ ```
211+
212+ Note that topology extension creation can be enabled only when PostGIS extension is enabled.
213+
203214* By default the PostGIS extension is disabled*
204215
205216## Granting user access to a database
Original file line number Diff line number Diff line change @@ -20,3 +20,4 @@ DB_TEMPLATE=${DB_TEMPLATE:-template1}
2020
2121DB_UNACCENT=${DB_UNACCENT:- false}
2222DB_POSTGIS=${DB_POSTGIS:- false}
23+ DB_POSTGIS_TOPOLOGY=${DB_POSTGIS_TOPOLOGY:- false}
Original file line number Diff line number Diff line change @@ -326,7 +326,10 @@ create_database() {
326326 if [[ ${DB_POSTGIS} == true ]]; then
327327 echo " ‣ Loading PostGIS extension..."
328328 psql -U ${PG_USER} -d ${database} -c " CREATE EXTENSION IF NOT EXISTS postgis;" > /dev/null 2>&1
329- psql -U ${PG_USER} -d ${database} -c " CREATE EXTENSION IF NOT EXISTS postgis_topology;" > /dev/null 2>&1
329+ if [[ ${DB_POSTGIS_TOPOLOGY} == true ]]; then
330+ echo " ‣ Loading PostGIS Topology extension..."
331+ psql -U ${PG_USER} -d ${database} -c " CREATE EXTENSION IF NOT EXISTS postgis_topology;" > /dev/null 2>&1
332+ fi
330333 fi
331334
332335 if [[ -n ${DB_USER} ]]; then
You can’t perform that action at this time.
0 commit comments