APPLIES TO: Azure Database for PostgreSQL - Flexible Server
Azure Database for PostgreSQL flexible server supports PostgreSQL versions 17, 16, 15, 14, 13, 12, 11. The Postgres community releases a new major version that contains new features about once a year. Additionally, each major version receives periodic bug fixes in the form of minor releases. Minor version upgrades include changes that are backward compatible with existing applications. Azure Database for PostgreSQL flexible server periodically updates the minor versions during a customer's maintenance window.
Major version upgrades are more complicated than minor version upgrades. They can include internal changes and new features that might not be backward compatible with existing applications.
Azure Database for PostgreSQL flexible server has a feature that performs an in-place major version upgrade of the server with just a click. This feature simplifies the upgrade process by minimizing the disruption to users and applications that access the server.
In-place upgrades retain the server name and other settings of the current server after the upgrade of a major version. They don't require data migration or changes to the application connection strings. In-place upgrades are faster and involve shorter downtime than data migration.
Upgrade ProcessHere are some of the important considerations with in-place major version upgrades:
If a precheck operation fails during an in-place major version upgrade, the upgrade is blocked with a detailed error message. Below are the known limitations that can cause the upgrade to fail or behave unexpectedly:
Unsupported Server Configurationspg_stat_activity
are not supported during major version upgrades.In-place major version upgrades do not support all PostgreSQL extensions. The upgrade will fail during the precheck if unsupported extensions are found.
timescaledb
, dblink
, orafce
, pg_partman
, postgres_fdw
pgrouting
, age
, azure_ai
, hll
, pg_diskann
pgrouting
, pg_repack
, and hypopg
are not supported for in-place upgrades and should be dropped before the upgrade and recreated after. These extensions are non-persistent and safe to reconfigure post-upgrade.These extensions must be removed from the azure.extensions server parameter prior to upgrade. If present, the upgrade will be blocked.
PostGIS-Specific ConsiderationsIf you're using PostGIS or any dependent extensions, you must configure the search_path server parameter to include:
postgis
, postgis_raster
, postgis_sfcgal
, postgis_tiger_geocoder
, postgis_topology
, address_standardizer
, address_standardizer_data_us
, fuzzystrmatch
EVENT TRIGGER
s before upgrading and then recreate them after the upgrade to ensure a smooth upgrade.pg_largeobject
) can cause upgrade failures due to high memory usage or log volume. Use vacuumlo utility to clean up unused LOs, and consider scaling up your server before upgrade if many LOs are still in use.Warning
Use caution with vacuumlo. vacuumlo
identifies orphaned large objects based on conventional reference columns (oid, lo). If your application uses custom or indirect reference types, valid large objects may be mistakenly deleted. Additionally, vacuumlo
may consume significant CPU, memory, and IOPS, especially in databases with millions of large objects. Run it during maintenance windows and test on non-prod first.
After the major version upgrade is complete, we recommend running the ANALYZE
command in each database to refresh the pg_statistic
table. Missing or stale statistics can lead to bad query plans, which in turn might degrade performance and take up excessive memory.
postgres=> analyze;
ANALYZE
View upgrade logs
Major version upgrade logs (PG_Upgrade_Logs
) provide direct access to detailed server logs. Integrating PG_Upgrade_Logs
into your upgrade process can help ensure a smoother and more transparent transition to new PostgreSQL versions.
You can configure your major version upgrade logs in the same way as server logs, by using the following server parameters:
logfiles.download_enable
to ON
.logfiles.retention_days
.To start using PG_Upgrade_Logs
, you can Configure capture of PostgreSQL server logs and major version upgrade logs.
You can access the upgrade logs through the UI for server logs. There, you can monitor the progress and details of your PostgreSQL major version upgrades in real time. This UI provides a centralized location for viewing logs, so you can more easily track and troubleshoot the upgrade process.
Benefits of using upgrade logsPG_Upgrade_Logs
provides valuable insights into the upgrade process. It captures detailed information about the operations performed, and it highlights any errors or warnings that occur. This level of detail is instrumental in diagnosing and resolving problems that might arise during the upgrade, for a smoother transition.Note
In-place major version upgrades are supported on automigrated servers. After a successful in-place Major Version Upgrade on an automigrated server, the username format username@servername will no longer be supported. Instead, you must use the standard format: username. To avoid authentication issues, carefully review and update all connection strings in your applications and scripts to ensure they use the updated username format after the upgrade.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4