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
|
|
|
|
-->
|
|
|
|
|
|
|
|
<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>' ]
|
2008-12-19 17:25:19 +01:00
|
|
|
[ OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] ) ]
|
Allow CURRENT/SESSION_USER to be used in certain commands
Commands such as ALTER USER, ALTER GROUP, ALTER ROLE, GRANT, and the
various ALTER OBJECT / OWNER TO, as well as ad-hoc clauses related to
roles such as the AUTHORIZATION clause of CREATE SCHEMA, the FOR clause
of CREATE USER MAPPING, and the FOR ROLE clause of ALTER DEFAULT
PRIVILEGES can now take the keywords CURRENT_USER and SESSION_USER as
user specifiers in place of an explicit user name.
This commit also fixes some quite ugly handling of special standards-
mandated syntax in CREATE USER MAPPING, which in particular would fail
to work in presence of a role named "current_user".
The special role specifiers PUBLIC and NONE also have more consistent
handling now.
Also take the opportunity to add location tracking to user specifiers.
Authors: Kyotaro Horiguchi. Heavily reworked by Álvaro Herrera.
Reviewed by: Rushabh Lathia, Adam Brightwell, Marti Raudsepp.
2015-03-09 19:41:54 +01:00
|
|
|
ALTER SERVER <replaceable class="PARAMETER">name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
|
2012-06-22 00:06:14 +02:00
|
|
|
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
|
|
|
|
have <literal>USAGE</> privilege on the server's foreign-data
|
|
|
|
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>
|
|
|
|
<term><literal>OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] )</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Change options for the
|
|
|
|
server. <literal>ADD</>, <literal>SET</>, and <literal>DROP</>
|
|
|
|
specify the action to be performed. <literal>ADD</> is assumed
|
|
|
|
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>
|
|
|
|
<term><replaceable class="PARAMETER">new_owner</replaceable></term>
|
|
|
|
<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>
|
|
|
|
Alter server <literal>foo</>, add connection options:
|
|
|
|
<programlisting>
|
|
|
|
ALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Alter server <literal>foo</>, change version,
|
|
|
|
change <literal>host</> option:
|
|
|
|
<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">
|
2010-04-03 09:23:02 +02:00
|
|
|
<member><xref linkend="sql-createserver"></member>
|
|
|
|
<member><xref linkend="sql-dropserver"></member>
|
2008-12-19 17:25:19 +01:00
|
|
|
</simplelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
</refentry>
|