param table related commands
The param table is used to manage the parameters in the postgresql.conf file that holds all the nodes in the AntDB cluster. When a parameter is modified, it is added to this table and used to identify it. For querying the modified configuration parameters, you can use the list param command.
set param
Command function:
Change the parameter in the postgresql.conf node configuration file. If the parameter is valid, the system will perform the relevant operation internally to make the change effective. This operation only applies to those parameter types that do not require restarting the cluster (such as sighup, user, superuser), while for modifying other types of parameters, the corresponding prompt will be given. If force is added at the end of the command, the validity of the parameter is not checked, but forced to be written to a file, and the system does not perform any operation, but only serves as a record.
Command format:
SET COORDINATOR [ MASTER | SLAVE ] ALL ( { parameter = value } [, ...] ) [ FORCE ]
SET COORDINATOR { MASTER | SLAVE} node_name ( { parameter = value } [, ...] ) [ FORCE ]
SET DATANODE [ MASTER | SLAVE ] ALL ( { parameter = value } [, ...] ) [ FORCE ]
SET DATANODE { MASTER | SLAVE } node_name ( { parameter = value } [, ...] ) [ FORCE ]
SET GTMCOORD ALL ( { parameter = value } [, ...] ) [ FORCE ]
SET GTMCOORD { MASTER | SLAVE } node_name ( { parameter = value } [, ...] ) [ FORCE ]
Command example:
-- Modify deadlock time on coord1
SET COORDINATOR MASTER coord1(deadlock_timeout = '1000ms');
-- Modify the checkpoint_timeout parameter in the configuration file on all datanodes.
SET DATANODE all(checkpoint_timeout = '1000s');
-- Modify a non-existent parameter in the configuration file on all datanodes
SET DATANODE all(checkpoint = '10s') FORCE;
reset param
Command function:
Change the parameters in the postgresql.conf file to default values.
Command format:
RESET COORDINATOR [ MASTER | SLAVE ] ALL ( parameter [, ...] ) [ FORCE ]
RESET COORDINATOR { MASTER | SLAVE } node_name ( parameter [, ...] ) [ FORCE ]
RESET DATANODE [ MASTER | SLAVE ] ALL ( parameter [, ...] ) [ FORCE ]
RESET DATANODE { MASTER | SLAVE } node_name ( parameter [, ...] ) [ FORCE ]
RESET GTMCOORD ALL ( parameter [, ...] ) [ FORCE ]
RESET GTMCOORD { MASTER | SLAVE } node_name ( parameter [, ...] ) [ FORCE ]
Command example:
-- Change the configuration parameter checkpoint_timeout of datanode master db1 to its default value. Where the * sign in the query result is an adaptor indicating all node names that meet the condition.
RESET DATANODE MASTER db1 (checkpoint_timeout);
-- Change all configuration parameters checkpoint_timeout in datanode to default values
RESET DATANODE all (checkpoint_timeout);
list param
Command function:
Query the list of modified parameters in the node's postgresql.conf configuration file.
Command format:
LIST PARAM
LIST PARAM node_type node_name [ sub_like_string ]
LIST PARAM cluster_type ALL [ sub_like_string ]
where node_type can be one of:
GTMCOORD MASTER
GTMCOORD SLAVE
COORDINATOR MASTER
COORDINATOR SLAVE
DATANODE MASTER
DATANODE SLAVE
where cluster_type can be one of:
GTMCOORD
COORDINATOR
DATANODE
DATANODE MASTER
DATANODE SLAVE
Command example:
--Query the modified parameter in the configuration file with the node type of datanode master and the node name of db1
LIST param DATANODE MASTER db1;
--Query the modified parameter in the configuration file in all nodes with the node type of coordinator
LIST param COORDINATOR all;
show
Command function:
Displays the actual parameter information of the cluster nodes and supports fuzzy query.
Command format:
SHOW PARAM node_name parameter
Command example:
-- Query the parameter with wal in the configuration file of node db1 in a fuzzy way
show param db1 wal;
-- Query the contents of the checkponit_timeout parameter in the configuration file of node db1
show param db1 checkpoint_timeout;