1ALTER SYSTEM(7)          PostgreSQL 15.4 Documentation         ALTER SYSTEM(7)
2
3
4

NAME

6       ALTER_SYSTEM - change a server configuration parameter
7

SYNOPSIS

9       ALTER SYSTEM SET configuration_parameter { TO | = } { value | 'value' | DEFAULT }
10
11       ALTER SYSTEM RESET configuration_parameter
12       ALTER SYSTEM RESET ALL
13

DESCRIPTION

15       ALTER SYSTEM is used for changing server configuration parameters
16       across the entire database cluster. It can be more convenient than the
17       traditional method of manually editing the postgresql.conf file.  ALTER
18       SYSTEM writes the given parameter setting to the postgresql.auto.conf
19       file, which is read in addition to postgresql.conf. Setting a parameter
20       to DEFAULT, or using the RESET variant, removes that configuration
21       entry from the postgresql.auto.conf file. Use RESET ALL to remove all
22       such configuration entries.
23
24       Values set with ALTER SYSTEM will be effective after the next server
25       configuration reload, or after the next server restart in the case of
26       parameters that can only be changed at server start. A server
27       configuration reload can be commanded by calling the SQL function
28       pg_reload_conf(), running pg_ctl reload, or sending a SIGHUP signal to
29       the main server process.
30
31       Only superusers and users granted ALTER SYSTEM privilege on a parameter
32       can change it using ALTER SYSTEM. Also, since this command acts
33       directly on the file system and cannot be rolled back, it is not
34       allowed inside a transaction block or function.
35

PARAMETERS

37       configuration_parameter
38           Name of a settable configuration parameter. Available parameters
39           are documented in Chapter 20.
40
41       value
42           New value of the parameter. Values can be specified as string
43           constants, identifiers, numbers, or comma-separated lists of these,
44           as appropriate for the particular parameter.  DEFAULT can be
45           written to specify removing the parameter and its value from
46           postgresql.auto.conf.
47

NOTES

49       This command can't be used to set data_directory, nor parameters that
50       are not allowed in postgresql.conf (e.g., preset options).
51
52       See Section 20.1 for other ways to set the parameters.
53

EXAMPLES

55       Set the wal_level:
56
57           ALTER SYSTEM SET wal_level = replica;
58
59       Undo that, restoring whatever setting was effective in postgresql.conf:
60
61           ALTER SYSTEM RESET wal_level;
62

COMPATIBILITY

64       The ALTER SYSTEM statement is a PostgreSQL extension.
65

SEE ALSO

67       SET(7), SHOW(7)
68
69
70
71PostgreSQL 15.4                      2023                      ALTER SYSTEM(7)
Impressum