Skip to content

fixing issue with PostGIS topology extension #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,17 @@ docker run --name postgresql -itd \
sameersbn/postgresql:9.4-11
```

Additionally, creation of PostGIS topology extension can be enabled by specifying `DB_POSTGIS_TOPOLOGY=true`:


```bash
docker run --name postgresql -itd \
--env 'DB_NAME=dbname' --env 'DB_POSTGIS=true' --env DB_POSTGIS_TOPOLOGY=true \
sameersbn/postgresql:9.4-11
```

Note that topology extension creation can be enabled only when PostGIS extension is enabled.

*By default the PostGIS extension is disabled*

## Granting user access to a database
Expand Down
1 change: 1 addition & 0 deletions runtime/env-defaults
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ DB_TEMPLATE=${DB_TEMPLATE:-template1}

DB_UNACCENT=${DB_UNACCENT:-false}
DB_POSTGIS=${DB_POSTGIS:-false}
DB_POSTGIS_TOPOLOGY=${DB_POSTGIS_TOPOLOGY:-false}
5 changes: 4 additions & 1 deletion runtime/functions
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ create_database() {
if [[ ${DB_POSTGIS} == true ]]; then
echo "‣ Loading PostGIS extension..."
psql -U ${PG_USER} -d ${database} -c "CREATE EXTENSION IF NOT EXISTS postgis;" >/dev/null 2>&1
psql -U ${PG_USER} -d ${database} -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;" >/dev/null 2>&1
if [[ ${DB_POSTGIS_TOPOLOGY} == true ]]; then
echo "‣ Loading PostGIS Topology extension..."
psql -U ${PG_USER} -d ${database} -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;" >/dev/null 2>&1
fi
fi

if [[ -n ${DB_USER} ]]; then
Expand Down