Skip to content
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

include postgis_raster extension in 3+ images and templates #266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions 10-3.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ The `postgis/postgis` image provides tags for running Postgres with [PostGIS](ht
This image ensures that the default database created by the parent `postgres` image will have the following extensions installed:

* `postgis`
* `postgis_raster`
* `postgis_topology`
* `postgis_tiger_geocoder`

Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately.

Unless `-e POSTGRES_DB` is passed to the container at startup time, this database will be named after the admin user (either `postgres` or the user specified with `-e POSTGRES_USER`). If you would prefer to use the older template database mechanism for enabling PostGIS, the image also provides a PostGIS-enabled template database called `template_postgis`.

## Usage
Expand Down
1 change: 1 addition & 0 deletions 10-3.1/alpine/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
8 changes: 6 additions & 2 deletions 10-3.1/alpine/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
Expand Down
1 change: 1 addition & 0 deletions 10-3.1/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
8 changes: 6 additions & 2 deletions 10-3.1/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
Expand Down
3 changes: 1 addition & 2 deletions 11-3.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ The `postgis/postgis` image provides tags for running Postgres with [PostGIS](ht
This image ensures that the default database created by the parent `postgres` image will have the following extensions installed:

* `postgis`
* `postgis_raster`
* `postgis_topology`
* `postgis_tiger_geocoder`

Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately.

Unless `-e POSTGRES_DB` is passed to the container at startup time, this database will be named after the admin user (either `postgres` or the user specified with `-e POSTGRES_USER`). If you would prefer to use the older template database mechanism for enabling PostGIS, the image also provides a PostGIS-enabled template database called `template_postgis`.

## Usage
Expand Down
1 change: 1 addition & 0 deletions 11-3.1/alpine/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
6 changes: 5 additions & 1 deletion 11-3.1/alpine/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
Expand Down
1 change: 1 addition & 0 deletions 11-3.1/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
6 changes: 5 additions & 1 deletion 11-3.1/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
Expand Down
3 changes: 1 addition & 2 deletions 12-3.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ The `postgis/postgis` image provides tags for running Postgres with [PostGIS](ht
This image ensures that the default database created by the parent `postgres` image will have the following extensions installed:

* `postgis`
* `postgis_raster`
* `postgis_topology`
* `postgis_tiger_geocoder`

Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately.

Unless `-e POSTGRES_DB` is passed to the container at startup time, this database will be named after the admin user (either `postgres` or the user specified with `-e POSTGRES_USER`). If you would prefer to use the older template database mechanism for enabling PostGIS, the image also provides a PostGIS-enabled template database called `template_postgis`.

## Usage
Expand Down
1 change: 1 addition & 0 deletions 12-3.1/alpine/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
6 changes: 5 additions & 1 deletion 12-3.1/alpine/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
Expand Down
1 change: 1 addition & 0 deletions 12-3.1/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
6 changes: 5 additions & 1 deletion 12-3.1/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
Expand Down
3 changes: 1 addition & 2 deletions 13-3.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ The `postgis/postgis` image provides tags for running Postgres with [PostGIS](ht
This image ensures that the default database created by the parent `postgres` image will have the following extensions installed:

* `postgis`
* `postgis_raster`
* `postgis_topology`
* `postgis_tiger_geocoder`

Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately.

Unless `-e POSTGRES_DB` is passed to the container at startup time, this database will be named after the admin user (either `postgres` or the user specified with `-e POSTGRES_USER`). If you would prefer to use the older template database mechanism for enabling PostGIS, the image also provides a PostGIS-enabled template database called `template_postgis`.

## Usage
Expand Down
1 change: 1 addition & 0 deletions 13-3.1/alpine/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
6 changes: 5 additions & 1 deletion 13-3.1/alpine/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
Expand Down
1 change: 1 addition & 0 deletions 13-3.1/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
6 changes: 5 additions & 1 deletion 13-3.1/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
Expand Down
3 changes: 1 addition & 2 deletions 13-master/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ The `postgis/postgis` image provides tags for running Postgres with [PostGIS](ht
This image ensures that the default database created by the parent `postgres` image will have the following extensions installed:

* `postgis`
* `postgis_raster`
* `postgis_topology`
* `postgis_tiger_geocoder`

Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately.

Unless `-e POSTGRES_DB` is passed to the container at startup time, this database will be named after the admin user (either `postgres` or the user specified with `-e POSTGRES_USER`). If you would prefer to use the older template database mechanism for enabling PostGIS, the image also provides a PostGIS-enabled template database called `template_postgis`.

## Usage
Expand Down
1 change: 1 addition & 0 deletions 13-master/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
6 changes: 5 additions & 1 deletion 13-master/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
Expand Down
3 changes: 1 addition & 2 deletions 14-3.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ The `postgis/postgis` image provides tags for running Postgres with [PostGIS](ht
This image ensures that the default database created by the parent `postgres` image will have the following extensions installed:

* `postgis`
* `postgis_raster`
* `postgis_topology`
* `postgis_tiger_geocoder`

Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately.

Unless `-e POSTGRES_DB` is passed to the container at startup time, this database will be named after the admin user (either `postgres` or the user specified with `-e POSTGRES_USER`). If you would prefer to use the older template database mechanism for enabling PostGIS, the image also provides a PostGIS-enabled template database called `template_postgis`.

## Usage
Expand Down
1 change: 1 addition & 0 deletions 14-3.1/alpine/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
6 changes: 5 additions & 1 deletion 14-3.1/alpine/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
Expand Down
1 change: 1 addition & 0 deletions 14-3.1/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
6 changes: 5 additions & 1 deletion 14-3.1/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
Expand Down
3 changes: 1 addition & 2 deletions 14-master/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ The `postgis/postgis` image provides tags for running Postgres with [PostGIS](ht
This image ensures that the default database created by the parent `postgres` image will have the following extensions installed:

* `postgis`
* `postgis_raster`
* `postgis_topology`
* `postgis_tiger_geocoder`

Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately.

Unless `-e POSTGRES_DB` is passed to the container at startup time, this database will be named after the admin user (either `postgres` or the user specified with `-e POSTGRES_USER`). If you would prefer to use the older template database mechanism for enabling PostGIS, the image also provides a PostGIS-enabled template database called `template_postgis`.

## Usage
Expand Down
1 change: 1 addition & 0 deletions 14-master/initdb-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
Expand Down
6 changes: 5 additions & 1 deletion 14-master/update-postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
-- Upgrade PostGIS
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Raster
CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';

-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
Expand Down
Loading