ALTER SYSTEM — change a server configuration parameter
ALTER SYSTEM SETconfiguration_parameter
{ TO | = } {value
| 'value
' | DEFAULT } ALTER SYSTEM RESETconfiguration_parameter
ALTER SYSTEM RESET ALL
ALTER SYSTEM
is used for changing server configuration
parameters across the entire database cluster. It can be more convenient
than the traditional method of manually editing
the lightdb.conf
file.
ALTER SYSTEM
writes the given parameter setting to
the lightdb.auto.conf
file, which is read in
addition to lightdb.conf
.
Setting a parameter to DEFAULT
, or using the
RESET
variant, removes that configuration entry from the
lightdb.auto.conf
file. Use RESET
ALL
to remove all such configuration entries.
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
function pg_reload_conf()
, running lt_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.
configuration_parameter
Name of a settable configuration parameter. Available parameters are documented in Chapter 17.
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.
DEFAULT
can be written to specify removing the
parameter and its value from lightdb.auto.conf
.
This command can't be used to set data_directory,
nor parameters that are not allowed in lightdb.conf
(e.g., preset options).
See Section 17.1 for other ways to set the parameters.
Set the wal_level
:
ALTER SYSTEM SET wal_level = replica;
Undo that, restoring whatever setting was effective
in lightdb.conf
:
ALTER SYSTEM RESET wal_level;
The ALTER SYSTEM
statement is a
LightDB extension.