Skip to content

Commit

Permalink
Disable unneeded postgis extensions (#199)
Browse files Browse the repository at this point in the history
Disables `postgis_topology`, `fuzzystrmatch` and
`postgis_tiger_geocoder` if they are initialized, because such
functionality is not used.

See https://registry.hub.docker.com/r/postgis/postgis
  • Loading branch information
hiddewie authored Jan 12, 2025
1 parent 696d740 commit ef38d7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ echo "Creating default database"
psql -c "SELECT 1 FROM pg_database WHERE datname = 'gis';" | grep -q 1 || createdb gis
psql -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
psql -c 'CREATE EXTENSION IF NOT EXISTS hstore;'
psql -c 'DROP EXTENSION IF EXISTS postgis_topology;'
psql -c 'DROP EXTENSION IF EXISTS fuzzystrmatch;'
psql -c 'DROP EXTENSION IF EXISTS postgis_tiger_geocoder;'

psql -d gis -f /sql/facility_functions.sql
psql -d gis -f /sql/import.sql
3 changes: 3 additions & 0 deletions import/docker-startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import)
psql -c "SELECT 1 FROM pg_database WHERE datname = 'gis';" | grep -q 1 || createdb gis
$PSQL -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
$PSQL -c 'CREATE EXTENSION IF NOT EXISTS hstore;'
$PSQL -c 'DROP EXTENSION IF EXISTS postgis_topology;'
$PSQL -c 'DROP EXTENSION IF EXISTS fuzzystrmatch;'
$PSQL -c 'DROP EXTENSION IF EXISTS postgis_tiger_geocoder;'

# Filter the data for more efficient import
# Store the filtered data for future use in the data directory
Expand Down

0 comments on commit ef38d7a

Please sign in to comment.