ALTER SYSTEM is used for changing server configuration parameters across the entire database cluster.
Description
ALTER SYSTEM is used for changing server configuration parameters across the entire database cluster.
Values set with ALTER SYSTEM will be effective after the next server configuration reload, or after the next server restart in the case of parameters that can only be changed at server start. A server configuration reload can be commanded by calling the SQL functionpg_reload_conf(), runningpg_ctl reload, or sending a SIGHUP signal to the main server process.
Only superusers can use ALTER SYSTEM. Also, since this command acts directly on the file system and cannot be rolled back, it is not allowed inside a transaction block or function.
Synopsis
ALTER SYSTEM SET configuration_parameter { TO | = } { value | 'value' | DEFAULT }
ALTER SYSTEM RESET configuration_parameter
ALTER SYSTEM RESET ALLParameters
configuration_parameter: Name of a settable configuration parameter.value: New value of the parameter. Values can be specified as string constants, identifiers, numbers, or comma-separated lists of these, as appropriate for the particular parameter. Values that are neither numbers nor valid identifiers must be quoted.DEFAULTcan be written to specify removing the parameter and its value frompostgresql.auto.conf.
Examples
Set thewal_level:
ALTER SYSTEM SET wal_level = replica;Undo that, restoring whatever setting was effective in postgresql.conf:
ALTER SYSTEM RESET wal_level;