title | description | author | ms.author | ms.service | ms.subservice | ms.devlang | ms.topic | ms.date | ms.custom |
---|---|---|---|---|---|---|---|---|---|
Configure parameters |
This article describes how to configure Postgres parameters in Azure Database for PostgreSQL - Flexible Server using the Azure CLI. |
varun-dhawan |
varundhawan |
postgresql |
flexible-server |
azurecli |
how-to |
8/14/2023 |
devx-track-azurecli |
[!INCLUDE applies-to-postgresql-flexible-server]
You can list, show, and update configuration parameters for an Azure PostgreSQL server using the Command Line Interface (Azure CLI). A subset of engine parameters is exposed at server-level and can be modified.
To step through this how-to guide, you need:
- Create an Azure Database for PostgreSQL flexible server instance and database by following Create an Azure Database for PostgreSQL flexible server instance
- Install Azure CLI command-line interface on your machine or use the Azure Cloud Shell in the Azure portal using your browser.
To list all modifiable parameters in a server and their values, run the az postgres flexible-server parameter list command.
You can list the server parameters for the server mydemoserver.postgres.database.azure.com under resource group myresourcegroup.
az postgres flexible-server parameter list --resource-group myresourcegroup --server-name mydemoserver
To show details about a particular parameter for a server, run the az postgres flexible-server parameter show command.
This example shows details of the log_min_messages server parameter for server mydemoserver.postgres.database.azure.com under resource group myresourcegroup.
az postgres flexible-server parameter show --name log_min_messages --resource-group myresourcegroup --server-name mydemoserver
You can also modify the value of a certain server parameter, which updates the underlying configuration value for the Azure Database for PostgreSQL flexible server engine. To update the parameter, use the az postgres flexible-server parameter set command.
To update the log_min_messages server parameter of server mydemoserver.postgres.database.azure.com under resource group myresourcegroup.
az postgres flexible-server parameter set --name log_min_messages --value INFO --resource-group myresourcegroup --server-name mydemoserver
If you want to reset the value of a parameter, you simply choose to leave out the optional --value
parameter, and the service applies the default value. In above example, it would look like:
az postgres flexible-server parameter set --name log_min_messages --resource-group myresourcegroup --server-name mydemoserver
This command resets the log_min_messages parameter to the default value WARNING. For more information on server parameters and permissible values, see PostgreSQL documentation on Setting Parameters.
- To configure and access server logs, see Server Logs in Azure Database for PostgreSQL - Flexible Server