]> begriffs open source - ai-pg/blob - full-docs/txt/sql-altersystem.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-altersystem.txt
1
2 ALTER SYSTEM
3
4    ALTER SYSTEM — change a server configuration parameter
5
6 Synopsis
7
8 ALTER SYSTEM SET configuration_parameter { TO | = } { value [, ...] | DEFAULT }
9
10 ALTER SYSTEM RESET configuration_parameter
11 ALTER SYSTEM RESET ALL
12
13 Description
14
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
36 Parameters
37
38    configuration_parameter
39           Name of a settable configuration parameter. Available parameters
40           are documented in Chapter 19.
41
42    value
43           New value of the parameter. Values can be specified as string
44           constants, identifiers, numbers, or comma-separated lists of
45           these, as appropriate for the particular parameter. Values that
46           are neither numbers nor valid identifiers must be quoted.
47           DEFAULT can be written to specify removing the parameter and its
48           value from postgresql.auto.conf.
49
50           For some list-accepting parameters, quoted values will produce
51           double-quoted output to preserve whitespace and commas; for
52           others, double-quotes must be used inside single-quoted strings
53           to get this effect.
54
55 Notes
56
57    This command can't be used to set data_directory, allow_alter_system,
58    nor parameters that are not allowed in postgresql.conf (e.g., preset
59    options).
60
61    See Section 19.1 for other ways to set the parameters.
62
63    ALTER SYSTEM can be disabled by setting allow_alter_system to off, but
64    this is not a security mechanism (as explained in detail in the
65    documentation for this parameter).
66
67 Examples
68
69    Set the wal_level:
70 ALTER SYSTEM SET wal_level = replica;
71
72    Undo that, restoring whatever setting was effective in postgresql.conf:
73 ALTER SYSTEM RESET wal_level;
74
75 Compatibility
76
77    The ALTER SYSTEM statement is a PostgreSQL extension.
78
79 See Also
80
81    SET, SHOW