Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / doc / src / sgml / ref / alter_server.sgml
blobfc5c64caa310ff12deb545b6b83bd73fd5e181e9
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-ALTERSERVER">
7 <refmeta>
8 <refentrytitle id="sql-alterserver-title">ALTER SERVER</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>ALTER SERVER</refname>
15 <refpurpose>change the definition of a foreign server</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-alterserver">
19 <primary>ALTER SERVER</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 ALTER SERVER <replaceable class="parameter">servername</replaceable> [ VERSION 'newversion' ]
25 [ OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] ) ]
26 ALTER SERVER <replaceable class="PARAMETER">servername</replaceable> OWNER TO <replaceable>new_owner</replaceable>
27 </synopsis>
28 </refsynopsisdiv>
30 <refsect1>
31 <title>Description</title>
33 <para>
34 <command>ALTER SERVER</command> changes the definition of a foreign
35 server. The first form changes the server version string or the
36 generic options of the server (at least one clause is required).
37 The second form changes the owner of the server.
38 </para>
40 <para>
41 To alter the server you must be the owner of the server.
42 Additionally to alter the owner, you must own the server and also
43 be a direct or indirect member of the new owning role, and you must
44 have <literal>USAGE</> privilege on the server's foreign-data
45 wrapper. (Note that superusers satisfy all these criteria
46 automatically.)
47 </para>
48 </refsect1>
50 <refsect1>
51 <title>Parameters</title>
53 <variablelist>
54 <varlistentry>
55 <term><replaceable class="parameter">servername</replaceable></term>
56 <listitem>
57 <para>
58 The name of an existing server.
59 </para>
60 </listitem>
61 </varlistentry>
63 <varlistentry>
64 <term><replaceable class="parameter">serverversion</replaceable></term>
65 <listitem>
66 <para>
67 New server version.
68 </para>
69 </listitem>
70 </varlistentry>
72 <varlistentry>
73 <term><literal>OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] )</literal></term>
74 <listitem>
75 <para>
76 Change options for the
77 server. <literal>ADD</>, <literal>SET</>, and <literal>DROP</>
78 specify the action to be performed. <literal>ADD</> is assumed
79 if no operation is explicitly specified. Option names must be
80 unique; names and values are also validated using the server's
81 foreign-data wrapper library.
82 </para>
83 </listitem>
84 </varlistentry>
85 </variablelist>
86 </refsect1>
88 <refsect1>
89 <title>Examples</title>
91 <para>
92 Alter server <literal>foo</>, add connection options:
93 <programlisting>
94 ALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');
95 </programlisting>
96 </para>
98 <para>
99 Alter server <literal>foo</>, change version,
100 change <literal>host</> option:
101 <programlisting>
102 ALTER SERVER foo VERSION '8.4' OPTIONS (SET host 'baz');
103 </programlisting>
104 </para>
105 </refsect1>
107 <refsect1>
108 <title>Compatibility</title>
110 <para>
111 <command>ALTER SERVER</command> conforms to ISO/IEC 9075-9 (SQL/MED).
112 </para>
113 </refsect1>
115 <refsect1>
116 <title>See Also</title>
118 <simplelist type="inline">
119 <member><xref linkend="sql-createserver" endterm="sql-createserver-title"></member>
120 <member><xref linkend="sql-dropserver" endterm="sql-dropserver-title"></member>
121 </simplelist>
122 </refsect1>
124 </refentry>