2008-12-19 17:25:19 +01:00
|
|
|
<!--
|
2010-09-20 22:08:53 +02:00
|
|
|
doc/src/sgml/ref/alter_server.sgml
|
2008-12-19 17:25:19 +01:00
|
|
|
PostgreSQL documentation
|
|
|
|
-->
|
|
|
|
|
2017-10-20 03:16:39 +02:00
|
|
|
<refentry id="sql-alterserver">
|
2014-02-24 03:25:35 +01:00
|
|
|
<indexterm zone="sql-alterserver">
|
|
|
|
<primary>ALTER SERVER</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
2008-12-19 17:25:19 +01:00
|
|
|
<refmeta>
|
2010-04-03 09:23:02 +02:00
|
|
|
<refentrytitle>ALTER SERVER</refentrytitle>
|
2009-06-19 17:28:25 +02:00
|
|
|
<manvolnum>7</manvolnum>
|
2008-12-19 17:25:19 +01:00
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
|
|
|
<refname>ALTER SERVER</refname>
|
|
|
|
<refpurpose>change the definition of a foreign server</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<synopsis>
|
2012-06-22 00:06:14 +02:00
|
|
|
ALTER SERVER <replaceable class="parameter">name</replaceable> [ VERSION '<replaceable class="parameter">new_version</replaceable>' ]
|
2017-10-09 04:00:57 +02:00
|
|
|
[ OPTIONS ( [ ADD | SET | DROP ] <replaceable class="parameter">option</replaceable> ['<replaceable class="parameter">value</replaceable>'] [, ... ] ) ]
|
|
|
|
ALTER SERVER <replaceable class="parameter">name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
|
|
|
|
ALTER SERVER <replaceable class="parameter">name</replaceable> RENAME TO <replaceable>new_name</replaceable>
|
2008-12-19 17:25:19 +01:00
|
|
|
</synopsis>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<command>ALTER SERVER</command> changes the definition of a foreign
|
|
|
|
server. The first form changes the server version string or the
|
|
|
|
generic options of the server (at least one clause is required).
|
|
|
|
The second form changes the owner of the server.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
To alter the server you must be the owner of the server.
|
|
|
|
Additionally to alter the owner, you must own the server and also
|
|
|
|
be a direct or indirect member of the new owning role, and you must
|
2017-10-09 03:44:17 +02:00
|
|
|
have <literal>USAGE</literal> privilege on the server's foreign-data
|
2008-12-19 17:25:19 +01:00
|
|
|
wrapper. (Note that superusers satisfy all these criteria
|
|
|
|
automatically.)
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Parameters</title>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2012-06-22 00:06:14 +02:00
|
|
|
<term><replaceable class="parameter">name</replaceable></term>
|
2008-12-19 17:25:19 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The name of an existing server.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2009-09-19 12:23:27 +02:00
|
|
|
<term><replaceable class="parameter">new_version</replaceable></term>
|
2008-12-19 17:25:19 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
New server version.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2017-10-09 04:00:57 +02:00
|
|
|
<term><literal>OPTIONS ( [ ADD | SET | DROP ] <replaceable class="parameter">option</replaceable> ['<replaceable class="parameter">value</replaceable>'] [, ... ] )</literal></term>
|
2008-12-19 17:25:19 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Change options for the
|
2017-10-09 03:44:17 +02:00
|
|
|
server. <literal>ADD</literal>, <literal>SET</literal>, and <literal>DROP</literal>
|
|
|
|
specify the action to be performed. <literal>ADD</literal> is assumed
|
2008-12-19 17:25:19 +01:00
|
|
|
if no operation is explicitly specified. Option names must be
|
|
|
|
unique; names and values are also validated using the server's
|
|
|
|
foreign-data wrapper library.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2011-12-09 19:42:30 +01:00
|
|
|
|
|
|
|
<varlistentry>
|
2017-10-09 04:00:57 +02:00
|
|
|
<term><replaceable class="parameter">new_owner</replaceable></term>
|
2011-12-09 19:42:30 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The user name of the new owner of the foreign server.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">new_name</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The new name for the foreign server.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2008-12-19 17:25:19 +01:00
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Examples</title>
|
|
|
|
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
Alter server <literal>foo</literal>, add connection options:
|
2008-12-19 17:25:19 +01:00
|
|
|
<programlisting>
|
|
|
|
ALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
Alter server <literal>foo</literal>, change version,
|
|
|
|
change <literal>host</literal> option:
|
2008-12-19 17:25:19 +01:00
|
|
|
<programlisting>
|
|
|
|
ALTER SERVER foo VERSION '8.4' OPTIONS (SET host 'baz');
|
2011-08-07 09:49:45 +02:00
|
|
|
</programlisting></para>
|
2008-12-19 17:25:19 +01:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Compatibility</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<command>ALTER SERVER</command> conforms to ISO/IEC 9075-9 (SQL/MED).
|
2011-12-09 19:42:30 +01:00
|
|
|
The <literal>OWNER TO</literal> and <literal>RENAME</literal> forms are
|
|
|
|
PostgreSQL extensions.
|
2008-12-19 17:25:19 +01:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
|
|
|
|
<simplelist type="inline">
|
2017-11-23 15:39:47 +01:00
|
|
|
<member><xref linkend="sql-createserver"/></member>
|
|
|
|
<member><xref linkend="sql-dropserver"/></member>
|
2008-12-19 17:25:19 +01:00
|
|
|
</simplelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
</refentry>
|