Configure parameters

Updated at:

This topic describes how to configure PolarDB parameters. You can modify parameters in the PolarDB console, or modify parameters through a client.

Modify parameters in the console

  1. Log on to the PolarDB console.
  2. In the upper-left corner, select the region where the cluster is deployed.

  3. Find the target cluster and click its ID.

  4. In the left-side navigation pane, choose Settings and Management > Parameters.

  5. Click Modify Parameters.

  6. Modify the cluster parameters and click Submit.

  7. In the dialog box that appears, click OK.

For more information, see Configure cluster parameters.

Modify parameters through a client

You can use the following commands to modify parameters through a client:

Command

Description

alter database

Modifies parameters at the database level. Different databases can have different parameter configurations. A session reconnection is required for changes to take effect.

alter role

Modifies parameters at the user level. Different users can have different parameters. User-level parameters override database-level parameters. A session reconnection is required for changes to take effect.

set

Modifies parameters at the session level. Changes take effect only for the current session. If the session is disconnected, the changes are lost.

Examples:

  • alter database

    test1=> alter database test1 set vacuum_cost_delay =10;
    ALTER DATABASE
  • alter role

    test1=> alter role test1 pg_db_role_setting;
     setdatabase | setrole |       setcofig
     ------------+---------+------------------------
           41891 |       0 | {vacuum_cost_delay=10}
           0 |     41284 | {random_page_cost=10}
    (2 rows)
  • set

    test1=> set random_page_cost=100;
    SET
    test1=> show random_page_cost;
     random_page_cost
    ------------------
     100
    (1 row)