update with latest build versions, includes custom build for postgres and migrating from v16 to v18
This commit is contained in:
28
build/postgresql-postgis/update-postgis.sh
Executable file
28
build/postgresql-postgis/update-postgis.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# Perform all actions as $POSTGRES_USER
|
||||
export PGUSER="$POSTGRES_USER"
|
||||
|
||||
POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
|
||||
|
||||
# Load PostGIS into both template_database and $POSTGRES_DB
|
||||
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
|
||||
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
|
||||
psql --dbname="$DB" -c "
|
||||
-- Upgrade PostGIS (includes raster)
|
||||
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
|
||||
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';
|
||||
|
||||
-- Upgrade Topology
|
||||
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
|
||||
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
|
||||
|
||||
-- Install Tiger dependencies in case not already installed
|
||||
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
|
||||
-- Upgrade US Tiger Geocoder
|
||||
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder VERSION '$POSTGIS_VERSION';
|
||||
ALTER EXTENSION postgis_tiger_geocoder UPDATE TO '$POSTGIS_VERSION';
|
||||
"
|
||||
done
|
||||
Reference in New Issue
Block a user