Upgrading PostGIS v3.2
This section walks you through the following upgrade examples for RHEL/CentOS 7 platforms:
- Example 1: Upgrading from PostGIS version 3.1 to 3.2
- 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.1 to 3.2
The following example walks you through upgrading from PostGIS version 3.1 to version 3.2 for EDB Postgres Advanced Server 14.
To avoid accidental upgrades, PostGIS version 3.1 and 3.2 use different package names. So, upgrading to version 3.2 requires that you first uninstall version 3.1. Once you install version 3.2, you can upgrade the PostGIS extensions.
Create the PostGIS extensions in PostGIS version 3.1, if you haven't already. For instructions, see Creating extensions.
Uninstall PostGIS version 3.1.
For EPAS version 14:
For older 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.2. For instructions, see Installing PostGIS on RHEL 7/OL 7 x86.
Upgrade the PostGIS extensions using the following command:
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
The following example walks you through the process of upgrading from PostGIS version 2.5.5 to PostGIS version 3.1.4 for EDB Postgres Advanced Server version 12.
Note
It is assumed that you have already created extensions for PostGIS version 2.5.5 as described in Creating extensions and 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 the superuser privileges and invoke the following command:
To update extensions, switch to
enterprisedb
user, connect to the database (where you have already created extensions) with the psql client application, and execute the following commands:
Example 3: Upgrading from PostGIS versions earlier than 2.5 to 3.1.4 on a different EDB Postgres Advanced Server version
The following example walks you through the process of upgrading 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.
It is assumed that you have 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 the superuser privileges and invoke the following command to 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
enterprisedb
user, connect to the database (where you have 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
enterprisedb
user and execute the following commands: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 re-open the psql client session:
Step 3 — Upgrade EDB Postgres Advanced Server version 10 to 14:
Assume the superuser privileges to 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 the PostGIS version 3.1.4 for EDB Postgres Advanced Server version 14.0:
Assume the superuser privileges to stop the EDB Postgres Advanced Server 14.0 service:
Switch to
enterprisedb
user and create atemp
folder:Execute the following commands to check cluster compatibility and consistency, as well as to perform the upgrade.
Assume the superuser privileges, navigate to the
bin
directory of EDB Postgres Advanced Server 14, and start the service:To update extensions, switch to
enterprisedb
user, connect to the database (where you have already created extensions) with the psql client application, and execute the following commands: