Skip to content

Commit c56e2ce

Browse files
author
Sameer Naik
committed
Merge pull request #47 from lwiechec/postgis-extension-finalization
fixing issue with PostGIS topology extension
2 parents c454c31 + c206007 commit c56e2ce

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

README.md

+11
Original file line numberDiff line numberDiff 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

runtime/env-defaults

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ DB_TEMPLATE=${DB_TEMPLATE:-template1}
2020

2121
DB_UNACCENT=${DB_UNACCENT:-false}
2222
DB_POSTGIS=${DB_POSTGIS:-false}
23+
DB_POSTGIS_TOPOLOGY=${DB_POSTGIS_TOPOLOGY:-false}

runtime/functions

+4-1
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)