This topic describes how to view and modify the parameters of an ApsaraDB RDS for PostgreSQL instance in the ApsaraDB RDS console or by calling the ApsaraDB RDS API. You can also view the parameter modification history in the ApsaraDB RDS console.

Usage notes

  • The modification of some parameters triggers a restart of your RDS instance. After you modify the parameters and click Apply Changes, your RDS instance immediately restarts. To check whether the modification of a parameter triggers a restart, you need to log on to the ApsaraDB RDS console, go to the Editable Parameters tab, and then view the value in the Force Restart column for the parameter. If the value is Yes, the modification of the parameter triggers a restart. If the value is No, the modification of the parameter does not trigger a restart. If the RDS instance restarts, your application is disconnected from the RDS instance. Proceed with caution.
  • When you modify the parameters of your RDS instance, you can view the valid values of a parameter in the Value Range column of the parameter on the Editable Parameters tab of the Parameters page in the ApsaraDB RDS console.

Modify parameters

  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane, click Parameters.
  3. On the Editable Parameters tab, modify the parameters of your RDS instance based on your business requirements.
    • Modify a single parameter of the RDS instance.
      1. Find the parameter and click the icon in the Running Parameter Value column.
      2. Enter a new value and click OK.
      3. Click Apply Changes.
      4. In the message that appears, click OK.
    • Modify multiple parameters at a time.
      1. Click Export Parameters to download the parameter settings of your RDS instance as a file to your computer.
      2. Open the file and modify the parameters.
      3. Click Import Parameters.
      4. In the Import Parameters dialog box, paste the parameter settings that you have copied from the file. Then, click OK.
      5. Confirm the values of the modified parameters and click Apply Changes.

View the parameter modification history

  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane, click Parameters.
  3. Click the Edit History tab.
  4. Select a time range and click OK.

Configure parameters by using expressions

You can set a parameter to an expression for your RDS instance. If you set an instance type-related parameter to an expression, the value of the parameter dynamically changes when the instance type changes.

The following table describes the supported expression syntax.

Category Description Example
Parameters The following parameters support expressions: work_mem, maintenance_work_mem, autovacuum_work_mem, max_parallel_workers, max_parallel_workers_per_gather, effective_cache_size, autovacuum_max_workers, max_wal_size, min_wal_size, temp_file_limit, wal_buffers, and max_parallel_maintenance_workers.
Note The max_parallel_maintenance_workers parameter is supported for PostgreSQL 11.0 to PostgreSQL 14.0. Other parameters are supported for PostgreSQL 10.0 to PostgreSQL 14.0.
effective_cache_size
Variables
  • AllocatedStorage: the storage capacity that is supported by the instance type in MB. The value of this variable is an integer.
  • DBInstanceClassMemory: the memory capacity that is supported by the instance type in bytes. The value of this variable is an integer.
  • DBInstanceClassCPU: the number of cores that are supported by the instance type. The value of this variable is an integer.
  • DBInstanceClassConnections: the maximum number of connections that are supported by the instance type. The value of this variable is an integer.
Note For more information about the instance types and the storage capacity, memory capacity, number of cores, and maximum number of connections that are supported by each instance type, see Primary ApsaraDB RDS for PostgreSQL instance types.
effective_cache_size={DBInstanceClassMemory/16384}
Operators
  • Expression syntax: An expression is enclosed by a pair of braces {}.
  • Division operator (/): This operator is used to divide a number by another number. If the quotient is a decimal, the quotient is not rounded, and only the integer part is counted. The dividend and divisor can be decimals.
  • Multiplication operator (*): This operator is used to multiply a number by another number. If the product is a decimal, the product is not rounded, and only the integer part is counted. The multipliers can be decimals.
Functions
  • The GREATEST() function returns the largest value among an array of integers or the largest value that is calculated by an array of expressions.
  • The LEAST() function returns the smallest value among an array of integers or the smallest value that is calculated by an array of expressions.
  • The SUM() function adds integers or the values that are calculated by specified expressions.
max_parallel_workers={GREATEST(DBInstanceClassCPU*3/4, 8)}

Related operations

Operation Description
Modify parameters of an instance Modifies the parameters of an instance.
Query the parameter template of an ApsaraDB for RDS instance Queries the parameter templates that are available for an instance.
Query parameter configurations Queries the parameter settings of an instance.

Parameters

For more information about the parameters that are supported for PostgreSQL, see the official PostgreSQL documentation.