1ALTER SERVER(7)          PostgreSQL 16.1 Documentation         ALTER SERVER(7)
2
3
4

NAME

6       ALTER_SERVER - change the definition of a foreign server
7

SYNOPSIS

9       ALTER SERVER name [ VERSION 'new_version' ]
10           [ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) ]
11       ALTER SERVER name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
12       ALTER SERVER name RENAME TO new_name
13

DESCRIPTION

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 be able to SET ROLE to the new owning
22       role, and you must have USAGE privilege on the server's foreign-data
23       wrapper. (Note that superusers satisfy all these criteria
24       automatically.)
25

PARAMETERS

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

EXAMPLES

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

COMPATIBILITY

55       ALTER SERVER conforms to ISO/IEC 9075-9 (SQL/MED). The OWNER TO and
56       RENAME forms are PostgreSQL extensions.
57

SEE ALSO

59       CREATE SERVER (CREATE_SERVER(7)), DROP SERVER (DROP_SERVER(7))
60
61
62
63PostgreSQL 16.1                      2023                      ALTER SERVER(7)
Impressum