Upgrading PostGIS v3
These examples show upgrading for RHEL/CentOS 7 platforms:
- Example 1: Upgrading from PostGIS version 3.3 to 3.4
- Example 2: Upgrading from PostGIS versions 2.5 or later to 3.1.4 on the same EDB Postgres Advanced Server version
- Example 3: Upgrading from PostGIS versions earlier than 2.5 to 3.1.4 on a different EDB Postgres Advanced Server version
Example 1: Upgrading from PostGIS version 3.3 to 3.4
This example upgrades from PostGIS version 3.3 to version 3.4 for EDB Postgres Advanced Server 15.
Upgrades from 3.1.4 and later versions
You can perform upgrades from PostGIS versions 3.1.4 and later (including skip upgrades, e.g. 3.1.4 to 3.4) as described in this example. Ensure you replace the source and target PostGIS versions, as well as the EDB Postgres Advanced Server version in commands accordingly.
To avoid accidental upgrades, PostGIS versions 3.3 and 3.4 use different package names. So, upgrading to version 3.4 requires that you first uninstall version 3.3. After you install version 3.4, you can upgrade the PostGIS extensions.
If you haven't already, create the PostGIS extensions in PostGIS version 3.3. For instructions, see Creating extensions.
Uninstall PostGIS version 3.3.
For EDB Posgres Advanced Server version 15:
For earlier versions of EDB Postgres Advanced Server:
Where
<xx>
is the version of EDB Postgres Advanced Server.For more information, see Uninstalling PostGIS.
Install PostGIS version 3.4. For instructions, see Installing PostGIS.
Upgrade the PostGIS extensions:
Note
If you first upgraded from a PostGIS version earlier than 2.5 to PostGIS version 3.1, then you must
DROP
thepostgis_raster extension
before executing the command.
Example 2: Upgrading from PostGIS versions 2.5 or later to 3.1.4 on the same EDB Postgres Advanced Server version
This example upgrades from PostGIS version 2.5.5 to PostGIS version 3.1.4 for EDB Postgres Advanced Server version 12.
Note
It's assumed that you already created extensions for PostGIS version 2.5.5 as described in Creating extensions and that the EDB Advanced Server 12 service is running.
To upgrade PostGIS version 2.5.5 to PostGIS version 3.1.4 for EDB Postgres Advanced Server 12, assume superuser privileges and invoke:
To update extensions, switch to the enterprisedb user, connect to the database where you already created extensions with the psql client application, and invoke:
Example 3: Upgrading from PostGIS versions earlier than 2.5 to 3.1.4 on a different EDB Postgres Advanced Server version
This example upgrades PostGIS version 2.4.6 for EDB Postgres Advanced Server 10 to PostGIS version 3.1.4 for EDB Postgres Advanced Server version 14:
Step 1 — Upgrade to PostGIS 3.1.1. This is an intermediate step required to resolve dependency issues.
Step 2 — Upgrade to PostGIS 3.1.4.
Step 3 — Upgrade EDB Postgres Advanced Server version 10 to 14.
Note
It's assumed that you already created extensions for the PostGIS version earlier than 2.5.5, as described in Creating extensions, and EDB Advanced Server 10 service is running.
When the PostGIS data has a dependency on the raster functions, upgrading to PostGIS version 3.1.4 requires dumping and reloading the data.
Step 1 — To upgrade PostGIS version 2.4.6 to 3.1.4, you need to upgrade it to 3.1.1 first:
Navigate to the bin directory of EDB Advanced Server 10:
Assume superuser privileges and upgrade to PostGIS version 3.1.1:
Note
See the Installing PostGIS on a Debian/Ubuntu Host section for information about Debian platform commands.
To update extensions, switch to the enterprisedb user, connect to the database where you already created extensions with the psql client application, and execute the following commands:
Step 2 — Upgrade to PostGIS version 3.1.4:
To upgrade PostGIS version 3.1.1 to 3.1.4, invoke the following command for EDB Postgres Advanced Server 10:
To update extensions, switch to the enterprisedb user and invoke:
With PostGIS version 3.1.4, the return type of the raster functions has changed, which requires dropping and creating the raster extension as part of the upgrade process.
Quit and reopen the psql client session:
Step 3 — Upgrade EDB Postgres Advanced Server version 10 to 14:
Assume superuser privileges and stop the EDB Postgres Advanced Server 10 service:
Install the EDB Postgres Advanced Server version 14:
Navigate to the
/bin
directory of EDB Advanced Server 14 and initialize the cluster:Install PostGIS version 3.1.4 for EDB Postgres Advanced Server version 14.0:
Assume superuser privileges and stop the EDB Postgres Advanced Server 14.0 service:
Switch to the enterprisedb user and create a
temp
folder:Check cluster compatibility and consistency and perform the upgrade:
Assume superuser privileges, navigate to the
bin
directory of EDB Postgres Advanced Server 14, and start the service:To update extensions, switch to the enterprisedb user, connect to the database where you already created extensions with the psql client application, and execute the following commands: