]> begriffs open source - ai-pg/blob - full-docs/man7/ALTER_SERVER.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / ALTER_SERVER.7
1 '\" t
2 .\"     Title: ALTER SERVER
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 SERVER" "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_SERVER \- change the definition of a foreign server
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 ALTER SERVER \fIname\fR [ VERSION \*(Aq\fInew_version\fR\*(Aq ]
36     [ OPTIONS ( [ ADD | SET | DROP ] \fIoption\fR [\*(Aq\fIvalue\fR\*(Aq] [, \&.\&.\&. ] ) ]
37 ALTER SERVER \fIname\fR OWNER TO { \fInew_owner\fR | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
38 ALTER SERVER \fIname\fR RENAME TO \fInew_name\fR
39 .fi
40 .SH "DESCRIPTION"
41 .PP
42 \fBALTER SERVER\fR
43 changes the definition of a foreign server\&. The first form changes the server version string or the generic options of the server (at least one clause is required)\&. The second form changes the owner of the server\&.
44 .PP
45 To alter the server you must be the owner of the server\&. Additionally to alter the owner, you must be able to
46 SET ROLE
47 to the new owning role, and you must have
48 USAGE
49 privilege on the server\*(Aqs foreign\-data wrapper\&. (Note that superusers satisfy all these criteria automatically\&.)
50 .SH "PARAMETERS"
51 .PP
52 \fIname\fR
53 .RS 4
54 The name of an existing server\&.
55 .RE
56 .PP
57 \fInew_version\fR
58 .RS 4
59 New server version\&.
60 .RE
61 .PP
62 OPTIONS ( [ ADD | SET | DROP ] \fIoption\fR [\*(Aq\fIvalue\fR\*(Aq] [, \&.\&.\&. ] )
63 .RS 4
64 Change options for the server\&.
65 ADD,
66 SET, and
67 DROP
68 specify the action to be performed\&.
69 ADD
70 is assumed if no operation is explicitly specified\&. Option names must be unique; names and values are also validated using the server\*(Aqs foreign\-data wrapper library\&.
71 .RE
72 .PP
73 \fInew_owner\fR
74 .RS 4
75 The user name of the new owner of the foreign server\&.
76 .RE
77 .PP
78 \fInew_name\fR
79 .RS 4
80 The new name for the foreign server\&.
81 .RE
82 .SH "EXAMPLES"
83 .PP
84 Alter server
85 foo, add connection options:
86 .sp
87 .if n \{\
88 .RS 4
89 .\}
90 .nf
91 ALTER SERVER foo OPTIONS (host \*(Aqfoo\*(Aq, dbname \*(Aqfoodb\*(Aq);
92 .fi
93 .if n \{\
94 .RE
95 .\}
96 .PP
97 Alter server
98 foo, change version, change
99 host
100 option:
101 .sp
102 .if n \{\
103 .RS 4
104 .\}
105 .nf
106 ALTER SERVER foo VERSION \*(Aq8\&.4\*(Aq OPTIONS (SET host \*(Aqbaz\*(Aq);
107 .fi
108 .if n \{\
109 .RE
110 .\}
111 .SH "COMPATIBILITY"
112 .PP
113 \fBALTER SERVER\fR
114 conforms to ISO/IEC 9075\-9 (SQL/MED)\&. The
115 OWNER TO
116 and
117 RENAME
118 forms are PostgreSQL extensions\&.
119 .SH "SEE ALSO"
120 CREATE SERVER (\fBCREATE_SERVER\fR(7)), DROP SERVER (\fBDROP_SERVER\fR(7))