2017-01-19 18:00:00 +01:00
|
|
|
<!--
|
|
|
|
doc/src/sgml/ref/alter_subscription.sgml
|
|
|
|
PostgreSQL documentation
|
|
|
|
-->
|
|
|
|
|
|
|
|
<refentry id="SQL-ALTERSUBSCRIPTION">
|
|
|
|
<indexterm zone="sql-altersubscription">
|
|
|
|
<primary>ALTER SUBSCRIPTION</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<refmeta>
|
|
|
|
<refentrytitle>ALTER SUBSCRIPTION</refentrytitle>
|
|
|
|
<manvolnum>7</manvolnum>
|
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
|
|
|
<refname>ALTER SUBSCRIPTION</refname>
|
|
|
|
<refpurpose>change the definition of a subscription</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<synopsis>
|
2017-04-26 18:05:11 +02:00
|
|
|
ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> WITH ( <replaceable class="PARAMETER">suboption</replaceable> [, ... ] )
|
2017-01-19 18:00:00 +01:00
|
|
|
|
2017-03-23 13:36:36 +01:00
|
|
|
<phrase>where <replaceable class="PARAMETER">suboption</replaceable> can be:</phrase>
|
2017-01-19 18:00:00 +01:00
|
|
|
|
2017-03-23 13:36:36 +01:00
|
|
|
SLOT NAME = <replaceable class="PARAMETER">slot_name</replaceable>
|
2017-04-14 19:58:46 +02:00
|
|
|
| SYNCHRONOUS_COMMIT = <replaceable class="PARAMETER">synchronous_commit</replaceable>
|
2017-03-23 13:36:36 +01:00
|
|
|
|
|
|
|
ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> SET PUBLICATION <replaceable class="PARAMETER">publication_name</replaceable> [, ...] { REFRESH WITH ( <replaceable class="PARAMETER">puboption</replaceable> [, ... ] ) | NOREFRESH }
|
2017-04-26 18:05:11 +02:00
|
|
|
ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> REFRESH PUBLICATION [ WITH ( <replaceable class="PARAMETER">puboption</replaceable> [, ... ] ) ]
|
2017-03-23 13:36:36 +01:00
|
|
|
|
|
|
|
<phrase>where <replaceable class="PARAMETER">puboption</replaceable> can be:</phrase>
|
|
|
|
|
|
|
|
COPY DATA | NOCOPY DATA
|
2017-01-19 18:00:00 +01:00
|
|
|
|
2017-03-22 20:11:13 +01:00
|
|
|
ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> CONNECTION '<replaceable>conninfo</replaceable>'
|
2017-01-19 18:00:00 +01:00
|
|
|
ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> ENABLE
|
|
|
|
ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> DISABLE
|
2017-05-02 21:29:30 +02:00
|
|
|
ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
|
|
|
|
ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> RENAME TO <replaceable>new_name</replaceable>
|
2017-01-19 18:00:00 +01:00
|
|
|
</synopsis>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<command>ALTER SUBSCRIPTION</command> can change most of the subscription
|
|
|
|
properties that can be specified
|
|
|
|
in <xref linkend="sql-createsubscription">.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
To alter the owner, you must also be a direct or indirect member of the
|
2017-04-26 18:05:11 +02:00
|
|
|
new owning role. The new owner has to be a superuser.
|
2017-01-19 18:00:00 +01:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Parameters</title>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">name</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The name of a subscription whose properties are to be altered.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><literal>CONNECTION '<replaceable class="parameter">conninfo</replaceable>'</literal></term>
|
|
|
|
<term><literal>SLOT NAME = <replaceable class="parameter">slot_name</replaceable></literal></term>
|
2017-04-14 19:58:46 +02:00
|
|
|
<term><literal>SYNCHRONOUS_COMMIT = <replaceable class="PARAMETER">synchronous_commit</replaceable></literal></term>
|
2017-01-19 18:00:00 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
These clauses alter properties originally set by
|
|
|
|
<xref linkend="SQL-CREATESUBSCRIPTION">. See there for more
|
|
|
|
information.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2017-03-23 13:36:36 +01:00
|
|
|
<varlistentry>
|
|
|
|
<term><literal>SET PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Changes list of subscribed publications. See
|
|
|
|
<xref linkend="SQL-CREATESUBSCRIPTION"> for more information.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
When <literal>REFRESH</literal> is specified, this command will also
|
|
|
|
act like <literal>REFRESH PUBLICATION</literal>. When
|
|
|
|
<literal>NOREFRESH</literal> is specified, the comamnd will not try to
|
|
|
|
refresh table information.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2017-04-08 04:42:03 +02:00
|
|
|
<term><literal>REFRESH PUBLICATION</literal></term>
|
2017-03-23 13:36:36 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Fetch missing table information from publisher. This will start
|
|
|
|
replication of tables that were added to the subscribed-to publications
|
|
|
|
since the last invocation of <command>REFRESH PUBLICATION</command> or
|
|
|
|
since <command>CREATE SUBSCRIPTION</command>.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The <literal>COPY DATA</literal> and <literal>NOCOPY DATA</literal>
|
|
|
|
options specify if the existing data in the publications that are being
|
|
|
|
subscribed to should be copied. <literal>COPY DATA</literal> is the
|
|
|
|
default.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2017-01-19 18:00:00 +01:00
|
|
|
<varlistentry>
|
|
|
|
<term><literal>ENABLE</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Enables the previously disabled subscription, starting the logical
|
|
|
|
replication worker at the end of transaction.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><literal>DISABLE</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Disables the running subscription, stopping the logical replication
|
|
|
|
worker at the end of transaction.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2017-03-23 13:36:36 +01:00
|
|
|
|
2017-05-02 21:29:30 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">new_owner</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The user name of the new owner of the subscription.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">new_name</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The new name for the subscription.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2017-01-19 18:00:00 +01:00
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Examples</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Change the publication subscribed by a subscription to
|
|
|
|
<literal>insert_only</literal>:
|
|
|
|
<programlisting>
|
|
|
|
ALTER SUBSCRIPTION mysub SET PUBLICATION insert_only;
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Disable (stop) the subscription:
|
|
|
|
<programlisting>
|
|
|
|
ALTER SUBSCRIPTION mysub DISABLE;
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Compatibility</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<command>ALTER SUBSCRIPTION</command> is a <productname>PostgreSQL</>
|
|
|
|
extension.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
|
|
|
|
<simplelist type="inline">
|
|
|
|
<member><xref linkend="sql-createsubscription"></member>
|
|
|
|
<member><xref linkend="sql-dropsubscription"></member>
|
|
|
|
<member><xref linkend="sql-createpublication"></member>
|
|
|
|
<member><xref linkend="sql-alterpublication"></member>
|
|
|
|
</simplelist>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|