Updated on 2026-10-21 GMT+08:00

Setting Parameters

Setting GUC Parameters

GaussDB provides six types of GUC parameters and multiple methods for modifying GUC parameters. You can set GUC parameters for databases, users, and sessions. For details, see Table 1.

  • Parameter names are case-insensitive.
  • The parameter values can be integers, floating points, strings, Boolean values, or enumerated values.
    • The Boolean values can be (on, off), (true, false), (yes, no), or (1, 0). The Boolean values (on, off) are recommended for GaussDB.
    • The enumerated value range is specified in the enumvals column of the system catalog pg_settings.
    • For parameters of the floating-point (real) type, the decimal point is required. For example, 1.0e-3 is valid, but 1e-3 is invalid.
    • According to the IEEE 754 standard, +0 and –0 are defined for floating-point numbers. In this case, the value –0 can be verified for numeric parameters.
    • gs_guc has a precision threshold of 1.0e-9 for checking the range of floating-point numbers.
  • For parameters using units, specify their units during the setting. Otherwise, default units are used.
    • The default units are specified in the unit column of pg_settings.
    • The unit of memory can be KB, MB, or GB.
    • The unit of time can be ms, s, min, h, or d.
  • You can set parameters related to CNs and DNs at a time, but cannot do the same to other parameters.

For details about parameters, see GUC Parameters.

Table 1 GUC parameter types

Parameter Type

Description

Setting Method

INTERNAL

Fixed parameters. They are set during database creation and cannot be modified. Users can only view the parameters by running the SHOW command or in the pg_settings view.

None

POSTMASTER

Database server parameters. They can be set when the database is started or in the configuration file.

Method 1 in Table 2.

SIGHUP

Global database parameters. They can be set during database startup or be modified later.

Method 1 or 2 in Table 2.

BACKEND

Session connection parameters. They are specified during session connection creation and cannot be modified after that. The parameter setting becomes invalid when the session is disconnected. The parameters of this type are internal parameters and not recommended for users to set it.

Method 1 or 2 in Table 2.

NOTE:

The parameter setting takes effect when the next session is created.

SUSET

Database administrator parameters. They can be set by common users during database startup or after the database is started. They can also be set by database administrators using SQL statements.

Method 1 or 2 by a common user, or method 3 by a database administrator in Table 2.

USERSET

Common user parameters. They can be set by any user at any time.

Method 1, 2, or 3 in Table 2.

NOTE:

When you set parameters of the USERSET type, the parameter value set using ALTER DATABASE takes precedence over that set using gs_guc. To make the parameter settings of gs_guc take effect, run the alter database xxx reset xxx command to reset the parameters.

You can set GUC parameters in GaussDB using the methods listed in Table 2.
Table 2 Methods for setting GUC parameters

No.

Setting Method

Method 1

  1. Log in to the management console.
  2. On the Instances page, click the name of the target instance to go to the Basic Information page.
  3. In the navigation pane on the left, choose Parameters. On the displayed page, modify parameters.

    If the parameters cannot be modified on the console, evaluate the modification risks and contact customer service for modification.

  4. Reboot the DB instance to make the modifications take effect.
    NOTE:

    Rebooting instances will interrupt user operations. Plan a proper execution window before the reboot.

Method 2

  1. Log in to the management console.
  2. On the Instances page, click the name of the target instance to go to the Basic Information page.
  3. In the navigation pane on the left, choose Parameters. On the displayed page, modify parameters.

    If the parameters cannot be modified on the console, evaluate the modification risks and contact customer service for modification.

Method 3

Modify a session-level parameter.

  • Set a session-level parameter.
    1
    gaussdb=# SET paraname TO value;
    

    The parameter value in the current session is changed. After you exit the session, the setting becomes invalid.

  • If you use method 1 or 2 to set a parameter that does not belong to the current node, the database displays a message indicating that the parameter is not supported.
  • You cannot set a parameter in the unit of pages by using method 1 or method 2.
  • When you use method 3 to set a parameter, if the parameter value is an integer, leading zeros will be filtered out. For example, SET paraname TO 008192 and SET paraname TO 8192 have the same effect.

Setting CM Parameters

GaussDB CM parameters fall into two categories: those that take effect only after a cluster restart, and those take effect immediately after a reload. For details, see Table 3.

Table 3 Methods for setting CM parameters

No.

Setting Method

Method 1

  1. Run the following command to modify parameters:
    cm_ctl set --param {--agent | --server} [-n NODEID] -k "PARAMETER=value"
    NOTE:
    Parameters
    • --agent: sets CM Agent parameters.
    • --server: sets CM Server parameters.
    • -n NODEID: sets the CM parameters of a specified node. NODEID indicates the node name, which can be queried by running the cm_ctl query -Cv command. If this parameter is not set, all nodes are set by default.
    • -k "PARAMETER=value": specifies the parameters to be set and values of the parameters. Only existing parameters can be set. Parameters cannot be added or deleted.
    Examples
    • Set the CM Agent parameter incremental_build to on.
      cm_ctl set --param --agent -k "incremental_build=on"
    • Set the CM Server parameter switch_rto to 600.
      cm_ctl set --param --server -k "switch_rto=600"
  2. Restart the cluster for the parameters to take effect.
    cm_ctl stop && cm_ctl start
    NOTE:

    Restarting the cluster results in operation interruption. Properly plan the restart to avoid affecting users.

Method 2

  1. Run the following command to modify parameters:
    cm_ctl set --param {--agent | --server} [-n NODEID] -k "PARAMETER=value"
    NOTE:
    Parameters
    • --agent: sets CM Agent parameters.
    • --server: sets CM Server parameters.
    • -n NODEID: sets the CM parameters of a specified node. NODEID indicates the node name, which can be queried by running the cm_ctl query -Cv command. If this parameter is not set, all nodes are set by default.
    • -k "PARAMETER=value": specifies the parameters to be set and values of the parameters. Only existing parameters can be set. Parameters cannot be added or deleted.
    Examples
    • Set the CM Agent parameter incremental_build to on.
      cm_ctl set --param --agent -k "incremental_build=on"
    • Set the CM Server parameter switch_rto to 600.
      cm_ctl set --param --server -k "switch_rto=600"
  2. Dynamically load CM parameters.
    cm_ctl reload --param {--agent | --server} [-n NODEID]
    NOTE:
    Parameters
    • --agent: dynamically loads CM Agent parameters.
    • --server: dynamically loads CM Server parameters.
    • -n NODEID: dynamically loads the CM parameters of a specified node. NODEID indicates the node name, which can be queried by running the cm_ctl query -Cv command.
    Examples
    • Dynamically load CM Agent parameters.
      cm_ctl reload --param --agent
    • Dynamically load CM Server parameters.
      cm_ctl reload --param --server