All Products
Search
Document Center

PolarDB:Configure parameters

更新時間:Jul 26, 2024

This topic describes how to modify the parameters of PolarDB in the PolarDB console or on a client.

Modify parameters in the PolarDB console

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region where the cluster to which you want to connect is deployed.

  3. Find the cluster and click its ID.

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

  5. Click Modify Parameter.

  6. Modify the cluster parameters and then click Submit Changes.

  7. In the message that appears, click OK.

For more information, see Configure cluster parameters.

Modify parameters on a client

The following table describes the commands that you can run to modify parameters on a client.

Command

Description

alter database

Modifies database-level parameters. You can specify different parameter values for different databases. After you modify the parameters, you must reconnect to the session to make new parameter settings to take effect.

alter role

Modifies user-level parameters. You can specify different parameter values for different users. The user-level parameter settings override database-level parameter settings. After you modify the parameters, you must reconnect to the session to make new parameter settings to take effect.

set

Modifies session-level parameters. The new parameter settings take effect only for the current session. If the session is disconnected, the new parameter settings become invalid.

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)