aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2019-04-05 14:52:45 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2019-04-05 18:05:18 -0300
commit9f06d79ef831ffa333f908f6d3debdb654292414 (patch)
treece7f58c5a4ed40c143244ec271134b8a343c8f69 /doc/src
parentde2b38419c4018fc8c2c917cc2cc752063096cfb (diff)
downloadpostgresql-9f06d79ef831ffa333f908f6d3debdb654292414.tar.gz
postgresql-9f06d79ef831ffa333f908f6d3debdb654292414.zip
Add facility to copy replication slots
This allows the user to create duplicates of existing replication slots, either logical or physical, and even changing properties such as whether they are temporary or the output plugin used. There are multiple uses for this, such as initializing multiple replicas using the slot for one base backup; when doing investigation of logical replication issues; and to select a different output plugins. Author: Masahiko Sawada Reviewed-by: Michael Paquier, Andres Freund, Petr Jelinek Discussion: https://postgr.es/m/CAD21AoAm7XX8y_tOPP6j4Nzzch12FvA1wPqiO690RCk+uYVstg@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml41
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 2aa1d1fc29e..5c3724ab9e3 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -20434,6 +20434,47 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
<row>
<entry>
<indexterm>
+ <primary>pg_copy_physical_replication_slot</primary>
+ </indexterm>
+ <literal><function>pg_copy_physical_replication_slot(<parameter>src_slot_name</parameter> <type>name</type>, <parameter>dst_slot_name</parameter> <type>name</type> <optional>, <parameter>temporary</parameter> <type>boolean</type></optional>)</function></literal>
+ </entry>
+ <entry>
+ (<parameter>slot_name</parameter> <type>name</type>, <parameter>lsn</parameter> <type>pg_lsn</type>)
+ </entry>
+ <entry>
+ Copies an existing physical replication slot name <parameter>src_slot_name</parameter>
+ to a physical replication slot named <parameter>dst_slot_name</parameter>.
+ The copied physical slot starts to reserve WAL from the same <acronym>LSN</acronym> as the
+ source slot.
+ <parameter>temporary</parameter> is optional. If <parameter>temporary</parameter>
+ is omitted, the same value as the source slot is used.
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <indexterm>
+ <primary>pg_copy_logical_replication_slot</primary>
+ </indexterm>
+ <literal><function>pg_copy_logical_replication_slot(<parameter>src_slot_name</parameter> <type>name</type>, <parameter>dst_slot_name</parameter> <type>name</type> <optional>, <parameter>temporary</parameter> <type>boolean</type> <optional>, <parameter>plugin</parameter> <type>name</type></optional></optional>)</function></literal>
+ </entry>
+ <entry>
+ (<parameter>slot_name</parameter> <type>name</type>, <parameter>lsn</parameter> <type>pg_lsn</type>)
+ </entry>
+ <entry>
+ Copies an existing logical replication slot name <parameter>src_slot_name</parameter>
+ to a logical replication slot named <parameter>dst_slot_name</parameter>
+ while changing the output plugin and persistence. The copied logical slot starts
+ from the same <acronym>LSN</acronym> as the source logical slot. Both
+ <parameter>temporary</parameter> and <parameter>plugin</parameter> are optional.
+ If <parameter>temporary</parameter> or <parameter>plugin</parameter> are omitted,
+ the same values as the source logical slot are used.
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <indexterm>
<primary>pg_logical_slot_get_changes</primary>
</indexterm>
<literal><function>pg_logical_slot_get_changes(<parameter>slot_name</parameter> <type>name</type>, <parameter>upto_lsn</parameter> <type>pg_lsn</type>, <parameter>upto_nchanges</parameter> <type>int</type>, VARIADIC <parameter>options</parameter> <type>text[]</type>)</function></literal>