HomeMogDBMogDB StackUqbar
v2.1

Documentation:v2.1

Supported Versions:

Other Versions:

Appendices

Table 1 GUC parameters

Parameter type. Remarks How to Set
INTERNAL Fixed parameter. It is set during database creation and cannot be modified. Users can only view the parameter by running the SHOW command or in the pg_settings view. None
POSTMASTER Database server parameter. It can be set when the database is started or in the configuration file. Method 1 in Table 2 Methods for setting GUC parameters.
SIGHUP Global database parameter. It can be set when the database is started or be modified later. Method 1 or 2 in Table 2 Methods for setting GUC parameters.
BACKEND Session connection parameter. It is specified during session connection creation and cannot be modified after that. The parameter setting becomes invalid when the session is disconnected. This is an internal parameter and not recommended for users to set it. Method 1 or 2 in Table 2 Methods for setting GUC parameters.
NOTE: The parameter setting takes effect when the next session is created.
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 statements. Method 1 or 2 by a common user, or method 3 by a database administrator in Table 2 Methods for setting GUC parameters.
USERSET Common user parameter. It can be set by any user at any time. Method 1, 2, or 3 in Table 2 Methods for setting GUC parameters.

Table 2 Methods for setting GUC parameters

No. Description
Method 1 1. Run the following command to set a parameter:
gs_guc set -D datadir -c "paraname=value"
NOTE:
If the parameter is a string variable, use -c parameter**="'value'"** or **-c "**parameter = 'value'".
Run the following command to set a parameter for database nodes at the same time:
gs_guc set -Nall -I all -c "paraname=value"
2. Restart the database to make the setting take effect.
NOTE:
Restarting MogDB results in operation interruption. Properly plan the restart to avoid affecting users.
gs_om -t stop && gs_om -t start
Method 2 gs_guc reload -D datadir -c "paraname=value"
NOTE:
Run the following command to set a parameter for database nodes at the same time:
gs_guc reload -N all -I all -c "paraname=value"
Method 3: Set parameters at database, user, or session levels.
- Set a database-level parameter.
mogdb=# ALTER DATABASE dbname SET paraname TO value;
The setting takes effect in the next session.
- Set a user-level parameter.
mogdb=# ALTER USER username SET paraname TO value;
The setting takes effect in the next session.
- Set a session-level parameter.
mogdb=# SET paraname TO value;
Parameter value in the current session is changed. After you exit the session, the setting becomes invalid.
Method 4 Modify database parameters using ALTER SYSTEM SET.
- Set a POSTMASTER-level parameter
mogdb=# ALTER SYSTEM SET paraname TO value;
Restart the system for the setting to take effect.
- Set a SIGHUP-level parameter.
mogdb=# ALTER SYSTEM SET paraname TO value;
The setting takes effect immediately. (Actually, there is a slight delay to wait for the thread reloading the parameter.)
- Set a BACKEND-level parameter.
mogdb=# ALTER SYSTEM SET paraname TO value;
The setting takes effect in the next session.
Copyright © 2011-2024 www.enmotech.com All rights reserved.