3
PostgreSQL documentation
6
<refentry id="SQL-ALTERSERVER">
8
<refentrytitle id="sql-alterserver-title">ALTER SERVER</refentrytitle>
9
<refmiscinfo>SQL - Language Statements</refmiscinfo>
13
<refname>ALTER SERVER</refname>
14
<refpurpose>change the definition of a foreign server</refpurpose>
17
<indexterm zone="sql-alterserver">
18
<primary>ALTER SERVER</primary>
23
ALTER SERVER <replaceable class="parameter">servername</replaceable> [ VERSION 'newversion' ]
24
[ OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] ) ]
25
ALTER SERVER <replaceable class="PARAMETER">servername</replaceable> OWNER TO <replaceable>new_owner</replaceable>
30
<title>Description</title>
33
<command>ALTER SERVER</command> changes the definition of a foreign
34
server. The first form changes the server version string or the
35
generic options of the server (at least one clause is required).
36
The second form changes the owner of the server.
40
To alter the server you must be the owner of the server.
41
Additionally to alter the owner, you must own the server and also
42
be a direct or indirect member of the new owning role, and you must
43
have <literal>USAGE</> privilege on the server's foreign-data
44
wrapper. (Note that superusers satisfy all these criteria
50
<title>Parameters</title>
54
<term><replaceable class="parameter">servername</replaceable></term>
57
The name of an existing server.
63
<term><replaceable class="parameter">serverversion</replaceable></term>
72
<term><literal>OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] )</literal></term>
75
Change options for the
76
server. <literal>ADD</>, <literal>SET</>, and <literal>DROP</>
77
specify the action to be performed. <literal>ADD</> is assumed
78
if no operation is explicitly specified. Option names must be
79
unique; names and values are also validated using the server's
80
foreign-data wrapper library.
88
<title>Examples</title>
91
Alter server <literal>foo</>, add connection options:
93
ALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');
98
Alter server <literal>foo</>, change version,
99
change <literal>host</> option:
101
ALTER SERVER foo VERSION '8.4' OPTIONS (SET host 'baz');
107
<title>Compatibility</title>
110
<command>ALTER SERVER</command> conforms to ISO/IEC 9075-9 (SQL/MED).
115
<title>See Also</title>
117
<simplelist type="inline">
118
<member><xref linkend="sql-createserver" endterm="sql-createserver-title"></member>
119
<member><xref linkend="sql-dropserver" endterm="sql-dropserver-title"></member>