Updated on 2025-08-19 GMT+08:00

Viewing Parameter Values

GaussDB uses a set of default GUC parameters after it is installed. You can modify the parameters to better fit your service scenarios and data volume.

Procedure

  1. Connect to the database.

    gsql -d postgres -p 8000

    postgres is the name of the database, and 8000 is the port number of the CN.

    If information similar to the following is displayed, the connection succeeds:

    gsql((GaussDB Kernel VxxxRxxxCxx build f521c606) compiled at 2021-09-16 14:55:22 last mr 6385 release)
    Non-SSL connection (SSL connection is recommended when requiring high-security)
    Type "help" for help.
    
    openGauss=# 

  2. View the parameter values in the database.

    • Method 1: Run the SHOW command.
      • Run the following command to view the value of a certain parameter:
        1
        openGauss=# SHOW server_version;
        

        server_version indicates the database version.

      • Run the following command to view values of all parameters:
        1
        openGauss=# SHOW ALL;
        
    • Method 2: Query the pg_settings view.
      • Run the following command to view the value of a certain parameter:
        1
        openGauss=# SELECT * FROM pg_settings WHERE NAME='server_version';
        
      • Run the following command to view values of all parameters:
        1
        openGauss=# SELECT * FROM pg_settings;
        

Example

Check the character encoding type of the client.

1
2
3
4
5
openGauss=# SHOW client_encoding;
 client_encoding 
----------------
 UTF8
(1 row)