You can modify the parameters of an RDS for PostgreSQL instance in the console or by calling an API operation to improve performance or meet specific business requirements. You can also query the parameter modification history.
Usage notes
Modifying some parameters triggers an instance restart. Your instance restarts immediately after you modify the parameters and click Submit Parameters. To determine if modifying a parameter will trigger a restart, check the value in the Restart column on the Editable Parameters page in the console. If the instance restarts, your application will be disconnected. Make sure that your business is prepared for the instance restart. Proceed with caution.
When you modify the value of a parameter in the console, refer to the Value Range column on the Editable Parameters tab.
When you modify the following parameters on the primary instance, the changes are synchronized to all associated read-only instances.
wal_level, max_replication_slots, max_wal_senders, max_locks_per_transaction, max_worker_processes, max_prepared_transactions
When you modify a parameter, the system attempts to apply the change. If the new parameter value is invalid or causes the instance to fail, the modification is rolled back and the result is marked as Failed. You can view the modification result in the Effective column on the Parameter Modification History tab.
The
log_statement
parameter cannot be modified directly. You can change the value of this parameter by enabling or disabling SQL Explorer and Audit in the SQL Explorer and Audit console.
Modify parameter values
Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the instance ID.
In the left navigation pane, click Parameters.
On the Editable Parameters tab, find the parameter that you want to modify. You can modify parameters one at a time or in batches. The following steps describe how to perform these operations:
Modifying a single parameter
Click the
icon next to the parameter that you want to modify.
Enter a destination value and click OK.
Click Submit Parameters.
In the dialog box that appears, specify when the new value takes effect. You can select Apply Immediately, Apply Within Maintenance Window, or Apply At A Specified Time. Then, click OK.
Modifying parameters in batches
Click Export Parameters to download the parameter file to your computer.
Open the parameter file and modify the parameter values.
Click Import Parameters.
In the Import Parameters window, paste the parameters and their values to modify, and then click OK.
Confirm the modifications in the parameter list and click Submit Parameters.
In the dialog box that appears, select when the new values take effect. You can select Apply Immediately, Apply Within Maintenance Window, or Apply At A Specified Time, and then click OK.
NoteOn the Scheduled Parameter Modification Tasks tab, you can view parameter modification tasks that are set to Apply Within Maintenance Window or Apply At A Specified Time.
Query parameter modification history
Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the instance ID.
In the left navigation pane, click Parameters.
Click the Parameter Modification History tab.
Select a time range and click OK.
Parameter expressions
You can set parameters using expressions. If you set an instance type-related parameter to an expression, the parameter value dynamically changes when you change the instance type. This ensures that the parameter value remains applicable to the new instance type.
The following table describes the supported expression syntax.
Category | Usage notes | Example |
Parameters | The following parameters support expressions: Note The max_parallel_maintenance_workers parameter is supported only for RDS PostgreSQL 11.0 and later. | effective_cache_size |
Variables |
Note For more information about the instance types and the storage capacity, memory size, number of CPU cores, and maximum number of connections that are supported by each instance type, see Primary RDS for PostgreSQL instance types. | effective_cache_size={DBInstanceClassMemory/16384} |
Operators |
| |
Functions |
| max_parallel_workers={GREATEST(DBInstanceClassCPU*3/4, 8)} |
References
For more information about PostgreSQL parameters, see PostgreSQL Parameter Description.
For more information about modifying parameters by calling API operations, see the following table:
API
Description
Modifies the parameters of an RDS instance.
Queries the parameter template of a database.
Queries the current parameter settings of an instance.