gpconfig
Sets server configuration parameters on all segments within a Greengage DB system.
Synopsis
gpconfig -c <param_name> -v <value>
[ -m <master_value> | --masteronly ]
[ --skipvalidation ]
[ --verbose ]
[ --debug ]
gpconfig -r <param_name>
[ --masteronly ]
[ --skipvalidation ]
[ --verbose ]
[ --debug ]
gpconfig -l
[ --skipvalidation ]
[ --verbose ]
[ --debug ]
gpconfig -s <param_name>
[ --file | --file-compare ]
[ --verbose ]
[ --debug ]
gpconfig --help
Description
The gpconfig utility allows you to set, unset, or view configuration parameters from the postgresql.conf files of all instances (master, segments, and mirrors) in your Greengage DB system.
When setting a parameter, you can also specify a different value for the master if necessary.
For example, parameters such as max_connections require a different setting on the master than what is used for the segments.
If you want to set or unset a global or master only parameter, use the --masteronly option.
For configuration parameters of type string, you may not pass values enclosed in single quotes to gpconfig -c.
gpconfig can only be used to manage certain parameters.
For example, you cannot use it to set parameters such as port, which is required to be distinct for every segment instance.
Use the -l option to see a complete list of configuration parameters supported by gpconfig.
When gpconfig sets a configuration parameter in a segment postgresql.conf file, the new parameter setting always displays at the bottom of the file.
When you use gpconfig to remove a configuration parameter setting, gpconfig comments out the parameter in all segment postgresql.conf files, thereby restoring the system default setting.
For example, if you use gpconfig to remove (comment out) a parameter and later add it back (set a new value), there will be two instances of the parameter; one that is commented out, and one that is enabled and inserted at the bottom of the postgresql.conf file.
After setting a parameter, you must restart your Greengage DB system or reload the postgresql.conf files in order for the change to take effect. Whether you require a restart or a reload depends on the parameter.
To show the currently set values for a parameter across the system, use the -s option.
gpconfig uses the following environment variables to connect to the Greengage DB master instance and obtain system configuration information:
-
PGHOST -
PGPORT -
PGUSER -
PGPASSWORD -
PGDATABASE
Options
- -c | --change <param_name>
-
Change a configuration parameter setting by adding the new setting to the bottom of the postgresql.conf files.
- -v | --value <value>
-
The value to use for the configuration parameter you specified with the
-coption. By default, this value is applied to all segments, their mirrors, the master, and the standby master.The utility correctly quotes the value when adding the setting to the postgresql.conf files.
To set the value to an empty string, enter empty single quotes (
''). - -m | --mastervalue <master_value>
-
The master value to use for the configuration parameter you specified with the
-coption. If specified, this value only applies to the master and standby master. This option can only be used with-v. - --masteronly
-
When specified,
gpconfigwill only edit the master postgresql.conf file. - -r | --remove <param_name>
-
Remove a configuration parameter setting by commenting out the entry in the postgresql.conf files.
- -l | --list
-
List all configuration parameters supported by the
gpconfigutility. - -s | --show <param_name>
-
Show the value for a configuration parameter used on all instances (master and segments) in the Greengage DB system. If there is a difference in a parameter value among the instances, the utility displays an error message. Running
gpconfigwith the-soption reads parameter values directly from the database, and not the postgresql.conf file. If you usegpconfigto set configuration parameters across all segments and then rungpconfig -sto verify the changes, you might still see the previous (old) values. You must reload the configuration files (gpstop -u) or restart the system (gpstop -r) for changes to take effect. - --file
-
For a configuration parameter, shows the value from the postgresql.conf file on all instances (master and segments) in the Greengage DB system. If there is a difference in a parameter value among the instances, the utility displays a message. Must be specified with the
-soption.For example, the configuration parameter
statement_memis set to64MBfor a user with theALTER ROLEcommand, and the value in the postgresql.conf file is128MB. Running the commandgpconfig -s statement_mem --filedisplays128MB. The commandgpconfig -s statement_memrun by the user displays64MB.Not valid with the
--file-compareoption. - --file-compare
-
For a configuration parameter, compares the current Greengage DB value with the value in the postgresql.conf files on hosts (master and segments). The values in the postgresql.conf files represent the value when Greengage DB is restarted.
If the values are not the same, the utility displays the values from all hosts. If all hosts have the same value, the utility displays a summary report.
Not valid with the
--fileoption. - --skipvalidation
-
Override the system validation checks of
gpconfigand allows you to operate on any server configuration parameter, including hidden parameters and restricted parameters that cannot be changed bygpconfig. When used with the-loption, it shows the list of restricted parameters.CAUTIONUse extreme caution when setting configuration parameters with this option.
- --verbose
-
Display additional log information during
gpconfigcommand execution. - --debug
-
Set logging output to debug level.
- -? | -h | --help
-
Display help.
Examples
Set the max_connections setting to 100 on all segments and 10 on the master:
$ gpconfig -c max_connections -v 100 -m 10
These examples show the syntax required due to Bash shell string processing:
$ gpconfig -c search_path -v '"\$user",public'
$ gpconfig -c dynamic_library_path -v '\$libdir'
The configuration parameters are added to the postgresql.conf file:
search_path='"$user",public' dynamic_library_path='$libdir'
Comment out all instances of the default_statistics_target configuration parameter, and restore the system default:
$ gpconfig -r default_statistics_target
List all configuration parameters supported by gpconfig:
$ gpconfig -l
Show the values of a particular configuration parameter across the system:
$ gpconfig -s max_connections