To use the flexible-server
command in the az postgres
command group, you need to install the az postgres flexible-server
extension. You can install the extension by running the following command: az extension add --name az postgres flexible-server
.
To upgrade an Azure PostgreSQL flexible server using a script and crontab, you can use the az postgres flexible-server update
command with the --sku-name
parameter to specify the new SKU name. For example, to upgrade to the GP_Gen5_8
SKU, you can run the following command: az postgres flexible-server update --resource-group myresourcegroup --name mydemoserver --sku-name GP_Gen5_8
.
To downgrade, you can follow the same process but specify the SKU name for the previous version. Note that downgrading may result in data loss, so it is important to back up your data before downgrading.
References:
- Troubleshoot Azure Database for PostgreSQL Flexible Server CLI errors
- Tutorial: Migrate Azure Database for PostgreSQL - Single Server to Flexible Server by using the Azure CLI
- Quickstart: Create an Azure Database for PostgreSQL Flexible Server using Azure CLI
- Major Version Upgrade of a flexible server - Flexible Server with Azure CLI
- PostgreSQL extensions in Azure Database for PostgreSQL - Flexible Server