]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/alter_server.sgml
Create a "sort support" interface API for faster sorting.
[postgresql] / doc / src / sgml / ref / alter_server.sgml
1 <!--
2 doc/src/sgml/ref/alter_server.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-ALTERSERVER">
7  <refmeta>
8   <refentrytitle>ALTER SERVER</refentrytitle>
9   <manvolnum>7</manvolnum>
10   <refmiscinfo>SQL - Language Statements</refmiscinfo>
11  </refmeta>
12
13  <refnamediv>
14   <refname>ALTER SERVER</refname>
15   <refpurpose>change the definition of a foreign server</refpurpose>
16  </refnamediv>
17
18  <indexterm zone="sql-alterserver">
19   <primary>ALTER SERVER</primary>
20  </indexterm>
21
22  <refsynopsisdiv>
23 <synopsis>
24 ALTER SERVER <replaceable class="parameter">server_name</replaceable> [ VERSION '<replaceable class="parameter">new_version</replaceable>' ]
25     [ OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] ) ]
26 ALTER SERVER <replaceable class="PARAMETER">server_name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
27 </synopsis>
28  </refsynopsisdiv>
29
30  <refsect1>
31   <title>Description</title>
32
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>
39
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>
49
50  <refsect1>
51   <title>Parameters</title>
52
53   <variablelist>
54    <varlistentry>
55     <term><replaceable class="parameter">server_name</replaceable></term>
56     <listitem>
57      <para>
58       The name of an existing server.
59      </para>
60     </listitem>
61    </varlistentry>
62
63    <varlistentry>
64     <term><replaceable class="parameter">new_version</replaceable></term>
65     <listitem>
66      <para>
67       New server version.
68      </para>
69     </listitem>
70    </varlistentry>
71
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>
87
88  <refsect1>
89   <title>Examples</title>
90
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>
97
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></para>
104  </refsect1>
105
106  <refsect1>
107   <title>Compatibility</title>
108
109   <para>
110    <command>ALTER SERVER</command> conforms to ISO/IEC 9075-9 (SQL/MED).
111   </para>
112  </refsect1>
113
114  <refsect1>
115   <title>See Also</title>
116
117   <simplelist type="inline">
118    <member><xref linkend="sql-createserver"></member>
119    <member><xref linkend="sql-dropserver"></member>
120   </simplelist>
121  </refsect1>
122
123 </refentry>