Supported Versions: Current (17) / 16 / 15 / 14 / 13
Development Versions: devel
Unsupported versions: 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

44.53. pg_settings

The view pg_settings provides access to run-time parameters of the server. It is essentially an alternative interface to the SHOW and SET commands. It also provides access to some facts about each parameter that are not directly available from SHOW, such as minimum and maximum values.

Table 44-54. pg_settings Columns

Name Type Description
name text Run-time configuration parameter name
setting text Current value of the parameter
unit text Implicit unit of the parameter
category text Logical group of the parameter
short_desc text A brief description of the parameter
extra_desc text Additional, more detailed, description of the parameter
context text Context required to set the parameter's value
vartype text Parameter type (bool, enum, integer, real, or string)
source text Source of the current parameter value
min_val text Minimum allowed value of the parameter (NULL for non-numeric values)
max_val text Maximum allowed value of the parameter (NULL for non-numeric values)
enumvals text[] Allowed values of an enum parameter (NULL for non-enum values)
boot_val text Parameter value assumed at server startup if the parameter is not otherwise set
reset_val text Value that RESET would reset the parameter to in the current session
sourcefile text Configuration file the current value was set in (NULL for values set from sources other than configuration files, or when examined by a non-superuser). Helpful when using configuration include directives
sourceline integer Line number within the configuration file the current value was set at (NULL for values set from sources other than configuration files, or when examined by a non-superuser)

The pg_settings view cannot be inserted into or deleted from, but it can be updated. An UPDATE applied to a row of pg_settings is equivalent to executing the SET command on that named parameter. The change only affects the value used by the current session. If an UPDATE is issued within a transaction that is later aborted, the effects of the UPDATE command disappear when the transaction is rolled back. Once the surrounding transaction is committed, the effects will persist until the end of the session, unless overridden by another UPDATE or SET.