]> begriffs open source - ai-pg/blob - full-docs/man7/ALTER_SYSTEM.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / ALTER_SYSTEM.7
1 '\" t
2 .\"     Title: ALTER SYSTEM
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "ALTER SYSTEM" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 ALTER_SYSTEM \- change a server configuration parameter
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 ALTER SYSTEM SET \fIconfiguration_parameter\fR { TO | = } { \fIvalue\fR [, \&.\&.\&.] | DEFAULT }
36
37 ALTER SYSTEM RESET \fIconfiguration_parameter\fR
38 ALTER SYSTEM RESET ALL
39 .fi
40 .SH "DESCRIPTION"
41 .PP
42 \fBALTER SYSTEM\fR
43 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
44 postgresql\&.conf
45 file\&.
46 \fBALTER SYSTEM\fR
47 writes the given parameter setting to the
48 postgresql\&.auto\&.conf
49 file, which is read in addition to
50 postgresql\&.conf\&. Setting a parameter to
51 DEFAULT, or using the
52 \fBRESET\fR
53 variant, removes that configuration entry from the
54 postgresql\&.auto\&.conf
55 file\&. Use
56 RESET ALL
57 to remove all such configuration entries\&.
58 .PP
59 Values set with
60 \fBALTER SYSTEM\fR
61 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
62 \fBpg_reload_conf()\fR, running
63 pg_ctl reload, or sending a
64 SIGHUP
65 signal to the main server process\&.
66 .PP
67 Only superusers and users granted
68 ALTER SYSTEM
69 privilege on a parameter can change it using
70 \fBALTER SYSTEM\fR\&. 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\&.
71 .SH "PARAMETERS"
72 .PP
73 \fIconfiguration_parameter\fR
74 .RS 4
75 Name of a settable configuration parameter\&. Available parameters are documented in
76 Chapter\ \&19\&.
77 .RE
78 .PP
79 \fIvalue\fR
80 .RS 4
81 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\&.
82 DEFAULT
83 can be written to specify removing the parameter and its value from
84 postgresql\&.auto\&.conf\&.
85 .sp
86 For some list\-accepting parameters, quoted values will produce double\-quoted output to preserve whitespace and commas; for others, double\-quotes must be used inside single\-quoted strings to get this effect\&.
87 .RE
88 .SH "NOTES"
89 .PP
90 This command can\*(Aqt be used to set
91 data_directory,
92 allow_alter_system, nor parameters that are not allowed in
93 postgresql\&.conf
94 (e\&.g\&.,
95 preset options)\&.
96 .PP
97 See
98 Section\ \&19.1
99 for other ways to set the parameters\&.
100 .PP
101 ALTER SYSTEM
102 can be disabled by setting
103 allow_alter_system
104 to
105 off, but this is not a security mechanism (as explained in detail in the documentation for this parameter)\&.
106 .SH "EXAMPLES"
107 .PP
108 Set the
109 wal_level:
110 .sp
111 .if n \{\
112 .RS 4
113 .\}
114 .nf
115 ALTER SYSTEM SET wal_level = replica;
116 .fi
117 .if n \{\
118 .RE
119 .\}
120 .PP
121 Undo that, restoring whatever setting was effective in
122 postgresql\&.conf:
123 .sp
124 .if n \{\
125 .RS 4
126 .\}
127 .nf
128 ALTER SYSTEM RESET wal_level;
129 .fi
130 .if n \{\
131 .RE
132 .\}
133 .SH "COMPATIBILITY"
134 .PP
135 The
136 \fBALTER SYSTEM\fR
137 statement is a
138 PostgreSQL
139 extension\&.
140 .SH "SEE ALSO"
141 \fBSET\fR(7), \fBSHOW\fR(7)