1ALTER SERVER(7) PostgreSQL 12.2 Documentation ALTER SERVER(7)
2
3
4
6 ALTER_SERVER - change the definition of a foreign server
7
9 ALTER SERVER name [ VERSION 'new_version' ]
10 [ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) ]
11 ALTER SERVER name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
12 ALTER SERVER name RENAME TO new_name
13
15 ALTER SERVER changes the definition of a foreign server. The first form
16 changes the server version string or the generic options of the server
17 (at least one clause is required). The second form changes the owner of
18 the server.
19
20 To alter the server you must be the owner of the server. Additionally
21 to alter the owner, you must own the server and also be a direct or
22 indirect member of the new owning role, and you must have USAGE
23 privilege on the server's foreign-data wrapper. (Note that superusers
24 satisfy all these criteria automatically.)
25
27 name
28 The name of an existing server.
29
30 new_version
31 New server version.
32
33 OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )
34 Change options for the server. ADD, SET, and DROP specify the
35 action to be performed. ADD is assumed if no operation is
36 explicitly specified. Option names must be unique; names and values
37 are also validated using the server's foreign-data wrapper library.
38
39 new_owner
40 The user name of the new owner of the foreign server.
41
42 new_name
43 The new name for the foreign server.
44
46 Alter server foo, add connection options:
47
48 ALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');
49
50 Alter server foo, change version, change host option:
51
52 ALTER SERVER foo VERSION '8.4' OPTIONS (SET host 'baz');
53
55 ALTER SERVER conforms to ISO/IEC 9075-9 (SQL/MED). The OWNER TO and
56 RENAME forms are PostgreSQL extensions.
57
59 CREATE SERVER (CREATE_SERVER(7)), DROP SERVER (DROP_SERVER(7))
60
61
62
63PostgreSQL 12.2 2020 ALTER SERVER(7)