1ALTER SYSTEM(7) PostgreSQL 16.1 Documentation ALTER SYSTEM(7)
2
3
4
6 ALTER_SYSTEM - change a server configuration parameter
7
9 ALTER SYSTEM SET configuration_parameter { TO | = } { value [, ...] | DEFAULT }
10
11 ALTER SYSTEM RESET configuration_parameter
12 ALTER SYSTEM RESET ALL
13
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
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. Values that are
45 neither numbers nor valid identifiers must be quoted. DEFAULT can
46 be written to specify removing the parameter and its value from
47 postgresql.auto.conf.
48
49 For some list-accepting parameters, quoted values will produce
50 double-quoted output to preserve whitespace and commas; for others,
51 double-quotes must be used inside single-quoted strings to get this
52 effect.
53
55 This command can't be used to set data_directory, nor parameters that
56 are not allowed in postgresql.conf (e.g., preset options).
57
58 See Section 20.1 for other ways to set the parameters.
59
61 Set the wal_level:
62
63 ALTER SYSTEM SET wal_level = replica;
64
65 Undo that, restoring whatever setting was effective in postgresql.conf:
66
67 ALTER SYSTEM RESET wal_level;
68
70 The ALTER SYSTEM statement is a PostgreSQL extension.
71
73 SET(7), SHOW(7)
74
75
76
77PostgreSQL 16.1 2023 ALTER SYSTEM(7)