Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 49c0864

Browse files
committed
Documentation for logical decoding.
Craig Ringer, Andres Freund, Christian Kruse, with edits by me.
1 parent 8bdd12b commit 49c0864

11 files changed

+1085
-5
lines changed

doc/src/sgml/catalogs.sgml

+26-1
Original file line numberDiff line numberDiff line change
@@ -5177,7 +5177,7 @@
51775177

51785178
<para>
51795179
For more on replication slots,
5180-
see <xref linkend="streaming-replication-slots">.
5180+
see <xref linkend="streaming-replication-slots"> and <xref linkend="logicaldecoding">.
51815181
</para>
51825182

51835183
<table>
@@ -5209,6 +5209,13 @@
52095209
<entry>The slot type - <literal>physical</> or <literal>logical</></entry>
52105210
</row>
52115211

5212+
<row>
5213+
<entry><structfield>plugin</structfield></entry>
5214+
<entry><type>text</type></entry>
5215+
<entry></entry>
5216+
<entry>The basename of the shared object containing the output plugin this logical slot is using, or null for physical slots.</entry>
5217+
</row>
5218+
52125219
<row>
52135220
<entry><structfield>datoid</structfield></entry>
52145221
<entry><type>oid</type></entry>
@@ -5242,6 +5249,24 @@
52425249
</entry>
52435250
</row>
52445251

5252+
<row>
5253+
<entry><structfield>xmin</structfield></entry>
5254+
<entry><type>xid</type></entry>
5255+
<entry></entry>
5256+
<entry>The oldest transaction that this slot needs the database to
5257+
retain. <literal>VACUUM</literal> cannot remove catalog tuples deleted
5258+
by any later transaction.
5259+
</entry>
5260+
</row>
5261+
5262+
<row>
5263+
<entry><structfield>catalog_xmin</structfield></entry>
5264+
<entry><type>xid</type></entry>
5265+
<entry></entry>
5266+
<entry>The <literal>xmin</literal>, or oldest transaction ID, that this
5267+
slot forces to be retained in the system catalogs. </entry>
5268+
</row>
5269+
52455270
<row>
52465271
<entry><structfield>restart_lsn</structfield></entry>
52475272
<entry><type>pg_lsn</type></entry>

doc/src/sgml/filelist.sgml

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
<!ENTITY nls SYSTEM "nls.sgml">
9292
<!ENTITY plhandler SYSTEM "plhandler.sgml">
9393
<!ENTITY fdwhandler SYSTEM "fdwhandler.sgml">
94+
<!ENTITY logicaldecoding SYSTEM "logicaldecoding.sgml">
9495
<!ENTITY protocol SYSTEM "protocol.sgml">
9596
<!ENTITY sources SYSTEM "sources.sgml">
9697
<!ENTITY storage SYSTEM "storage.sgml">

doc/src/sgml/func.sgml

+99
Original file line numberDiff line numberDiff line change
@@ -16437,9 +16437,108 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1643716437
command <literal>DROP_REPLICATION_SLOT</>.
1643816438
</entry>
1643916439
</row>
16440+
16441+
<row>
16442+
<entry>
16443+
<indexterm>
16444+
<primary>pg_create_logical_replication_slot</primary>
16445+
</indexterm>
16446+
<literal><function>pg_create_logical_replication_slot(<parameter>slotname</parameter> <type>name</type>, <parameter>plugin</parameter> <type>name</type>)</function></literal>
16447+
</entry>
16448+
<entry>
16449+
(<parameter>slotname</parameter> <type>name</type>, <parameter>xlog_position</parameter> <type>pg_lsn</type>)
16450+
</entry>
16451+
<entry>
16452+
Creates a new logical (decoding) replication slot named
16453+
<parameter>slotname</parameter> using the output plugin
16454+
<parameter>plugin</parameter>. A call to this function has the same
16455+
effect as the replication protocol command
16456+
<literal>CREATE REPLICATION SLOT ... LOGICAL</literal>.
16457+
</entry>
16458+
</row>
16459+
16460+
<row>
16461+
<entry>
16462+
<indexterm>
16463+
<primary>pg_logical_slot_get_changes</primary>
16464+
</indexterm>
16465+
<literal><function>pg_logical_slot_get_changes(<parameter>slotname</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>
16466+
</entry>
16467+
<entry>
16468+
(<parameter>location</parameter> <type>pg_lsn</type>, <parameter>xid</parameter> <type>xid</type>, <parameter>data</parameter> <type>text</type>)
16469+
</entry>
16470+
<entry>
16471+
Returns changes in the slot <parameter>slotname</parameter>, starting
16472+
from the point at which since changes have been consumed last. If
16473+
<parameter>upto_lsn</> and <parameter>upto_nchanges</> are NULL,
16474+
logical decoding will continue until end of WAL. If
16475+
<parameter>upto_lsn</> is non-NULL, decoding will include only
16476+
those transactions which commit prior to the specified LSN. If
16477+
<parameter>upto_nchanges</parameter> is non-NULL, decoding will
16478+
stop when the number of rows produced by decoding exceeds
16479+
the specified value. Note, however, that the actual number of
16480+
rows returned may be larger, since this limit is only checked after
16481+
adding the rows produced when decoding each new transaction commit.
16482+
</entry>
16483+
</row>
16484+
16485+
<row>
16486+
<entry>
16487+
<indexterm>
16488+
<primary>pg_logical_slot_peek_changes</primary>
16489+
</indexterm>
16490+
<literal><function>pg_logical_slot_peek_changes(<parameter>slotname</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>
16491+
</entry>
16492+
<entry>
16493+
(<parameter>location</parameter> <type>text</type>, <parameter>xid</parameter> <type>xid</type>, <parameter>data</parameter> <type>text</type>)
16494+
</entry>
16495+
<entry>
16496+
Behaves just like
16497+
the <function>pg_logical_slot_get_changes()</function> function,
16498+
except that changes are not consumed; that is, they will be returned
16499+
again on future calls.
16500+
</entry>
16501+
</row>
16502+
16503+
<row>
16504+
<entry>
16505+
<indexterm>
16506+
<primary>pg_logical_slot_get_binary_changes</primary>
16507+
</indexterm>
16508+
<literal><function>pg_logical_slot_get_binary_changes(<parameter>slotname</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>
16509+
</entry>
16510+
<entry>
16511+
(<parameter>location</parameter> <type>pg_lsn</type>, <parameter>xid</parameter> <type>xid</type>, <parameter>data</parameter> <type>bytea</type>)
16512+
</entry>
16513+
<entry>
16514+
Behaves just like
16515+
the <function>pg_logical_slot_get_changes()</function> function,
16516+
except that changes are returned as <type>bytea</type>.
16517+
</entry>
16518+
</row>
16519+
16520+
<row>
16521+
<entry>
16522+
<indexterm>
16523+
<primary>pg_logical_slot_peek_binary_changes</primary>
16524+
</indexterm>
16525+
<literal><function>pg_logical_slot_peek_binary_changes(<parameter>slotname</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>
16526+
</entry>
16527+
<entry>
16528+
(<parameter>location</parameter> <type>pg_lsn</type>, <parameter>xid</parameter> <type>xid</type>, <parameter>data</parameter> <type>bytea</type>)
16529+
</entry>
16530+
<entry>
16531+
Behaves just like
16532+
the <function>pg_logical_slot_get_changes()</function> function,
16533+
except that changes are returned as <type>bytea</type> and that
16534+
changes are not consumed; that is, they will be returned again
16535+
on future calls.
16536+
</entry>
16537+
</row>
1644016538
</tbody>
1644116539
</tgroup>
1644216540
</table>
16541+
1644316542
</sect2>
1644416543

1644516544
<sect2 id="functions-admin-dbobject">

0 commit comments

Comments
 (0)