An Azure managed PostgreSQL database service for app development and deployment.
Hi Srihari Parameswaran,
Follow the steps below to resolve the PostgreSQL upgrade failure from 13.23 to 17.7.
Step 1: Confirm PostgreSQL 17 support in the region
First, verify that PostgreSQL 17 is available as an upgrade option for your server in the Azure Portal. Major version upgrades are enabled in phases by region, and if PostgreSQL 17 is not enabled for your server, the upgrade may fail with an InternalServerError.
Step 2: Remove all read replicas
Next, ensure that no read replicas are configured on the server. Azure does not allow in‑place major version upgrades when read replicas exist, so all replicas must be removed before retrying the upgrade.
Step 3: Check and remove unsupported extensions (per database
Then, check all databases on the server for unsupported extensions. Azure validates extensions at the database level, not just at the server level. If any database contains unsupported extensions such as timescaledb, dblink, postgres_fdw, pgaudit, or hypopg, the upgrade will fail. Remove these extensions before proceeding.
Step 4: Remove logical replication slots
After that, verify that there are no logical replication slots configured. Logical replication slots can block the major version upgrade and must be dropped prior to starting the upgrade.
Step 5: Ensure sufficient free storage
Confirm that the server has at least 10–20% free storage space available. Azure requires this free space to create temporary files during the upgrade process, and insufficient storage can cause the upgrade to fail.
Step 6: Run the Azure pre‑upgrade validation
Finally, retry the upgrade from the Azure Portal and review the pre‑upgrade validation results. If the pre‑check completes successfully, the upgrade should proceed without errors.
This guidance aligns with Microsoft’s official recommendations for major version upgrades on Azure Database for PostgreSQL Flexible Server.
Reference Link:
Major version upgrades – Azure Database for PostgreSQL https://learn.microsoft.com/azure/postgresql/configure-maintain/concepts-major-version-upgrade [learn.microsoft.com]
How to perform a major version upgrade https://learn.microsoft.com/azure/postgresql/configure-maintain/how-to-perform-major-version-upgrade [docs.azure.cn]