diff --git a/start-postgis.sh b/start-postgis.sh index 21dfb34..026b854 100755 --- a/start-postgis.sh +++ b/start-postgis.sh @@ -70,6 +70,13 @@ RESULT=`su - postgres -c "psql -l | grep postgis | wc -l"` if [[ ${RESULT} == '1' ]] then echo 'Postgis Already There' + + if [ ${HSTORE} == "true" ]; then + echo 'HSTORE is only useful when you create the postgis database.' + fi + if [ ${TOPOLOGY} == "true" ]; then + echo 'TOPOLOGY is only useful when you create the postgis database.' + fi else echo "Postgis is missing, installing now" # Note the dockerfile must have put the postgis.sql and spatialrefsys.sql scripts into /root/ @@ -82,6 +89,17 @@ else echo "Loading postgis extension" su - postgres -c "psql template_postgis -c 'CREATE EXTENSION postgis;'" + if [ ${HSTORE} == "true" ] + then + echo "Enabling hstore in the template" + su - postgres -c "psql template_postgis -c 'CREATE EXTENSION hstore;'" + fi + if [ ${TOPOLOGY} == "true" ] + then + echo "Enabling topology in the template" + su - postgres -c "psql template_postgis -c 'CREATE EXTENSION postgis_topology;'" + fi + # Needed when importing old dumps using e.g ndims for constraints echo "Loading legacy sql" su - postgres -c "psql template_postgis -f $SQLDIR/legacy_minimal.sql"