Resetting Parameters
Context
GaussDB(DWS) provides multiple methods to set the GUC parameters of databases, users, or sessions.
- Parameter names are case-insensitive.
- A parameter value can be an integer, floating point value, string, Boolean value, or enumerated value.
- The Boolean values can be on/off, true/false, yes/no, or 1/0, and are case-insensitive.
- The enumerated value range is specified in the enumvals column of the pg_settings system catalog.
- For parameters using units, specify their units during the setting, or 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 CN and DN parameters at a time, but cannot do the same to other parameters.
For details about the parameters, see GUC Parameter Usage.
Setting GUC Parameters
GaussDB(DWS) provides the following GUC parameters. Table 1 lists their types and setting methods.
| Type | Description | Setting Method |
|---|---|---|
| SUSET | Database administrator parameter. It can be set by common users when or after the database is started. It can also be set by database administrators using SQL commands. | Method by a database administrator in Table 2 |
| USERSET | Common user parameter. It can be set by any user at any time. | Method in Table 2 |
| No. | Method | ||||||
|---|---|---|---|---|---|---|---|
| Method | Set parameters at database, user, or session levels.
|
Procedure
The following example shows how to set explain_perf_mode.
- View the value of explain_perf_mode.
1 2 3 4 5
SHOW explain_perf_mode; explain_perf_mode ------------------- normal (1 row)
- Set explain_perf_mode.
Perform one of the following operations:
- Set a database-level parameter.
1
ALTER DATABASE postgres SET explain_perf_mode TO pretty;
The setting takes effect in the next session.
- Set a user-level parameter.
1
ALTER USER dbadmin SET explain_perf_mode TO pretty;
The setting takes effect in the next session.
- Set a session-level parameter.
1
SET explain_perf_mode TO pretty;
- Set a database-level parameter.
- Check whether the parameter is correctly set.
1 2 3 4 5
SHOW explain_perf_mode; explain_perf_mode -------------- pretty (1 row)
Last Article: Viewing Parameter Values
Next Article: GUC Parameter Usage
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.