From c3b5cfe33cda6e28bbdc75534706c1a00a9e6c4b Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Wed, 15 Feb 2017 18:15:47 -0500
Subject: Formatting and docs corrections for logical decoding output plugins.
Make the typedefs for output plugins consistent with project style;
they were previously not even consistent with each other as to layout
or inclusion of parameter names. Make the documentation look the same,
and fix errors therein (missing and misdescribed parameters).
Back-patch because of the documentation bugs.
---
doc/src/sgml/logicaldecoding.sgml | 37 ++++++++++++++-----------------------
1 file changed, 14 insertions(+), 23 deletions(-)
(limited to 'doc/src')
diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index b65de324f53..d595c2eae8b 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -366,7 +366,7 @@ typedef struct OutputPluginCallbacks
LogicalDecodeShutdownCB shutdown_cb;
} OutputPluginCallbacks;
-typedef void (*LogicalOutputPluginInit)(struct OutputPluginCallbacks *cb);
+typedef void (*LogicalOutputPluginInit) (struct OutputPluginCallbacks *cb);
The begin_cb, change_cb
and commit_cb callbacks are required,
@@ -450,11 +450,9 @@ CREATE TABLE another_catalog_table(data text) WITH (user_catalog_table = true);
a replication slot is created or asked to stream changes, independent
of the number of changes that are ready to be put out.
-typedef void (*LogicalDecodeStartupCB) (
- struct LogicalDecodingContext *ctx,
- OutputPluginOptions *options,
- bool is_init
-);
+typedef void (*LogicalDecodeStartupCB) (struct LogicalDecodingContext *ctx,
+ OutputPluginOptions *options,
+ bool is_init);
The is_init parameter will be true when the
replication slot is being created and false
@@ -489,9 +487,7 @@ typedef struct OutputPluginOptions
be used to deallocate resources private to the output plugin. The slot
isn't necessarily being dropped, streaming is just being stopped.
-typedef void (*LogicalDecodeShutdownCB) (
- struct LogicalDecodingContext *ctx
-);
+typedef void (*LogicalDecodeShutdownCB) (struct LogicalDecodingContext *ctx);
@@ -504,10 +500,8 @@ typedef void (*LogicalDecodeShutdownCB) (
start of a committed transaction has been decoded. Aborted transactions
and their contents never get decoded.
-typedef void (*LogicalDecodeBeginCB) (
- struct LogicalDecodingContext *,
- ReorderBufferTXN *txn
-);
+typedef void (*LogicalDecodeBeginCB) (struct LogicalDecodingContext *ctx,
+ ReorderBufferTXN *txn);
The txn parameter contains meta information about
the transaction, like the time stamp at which it has been committed and
@@ -525,10 +519,9 @@ typedef void (*LogicalDecodeBeginCB) (
rows will have been called before this, if there have been any modified
rows.
-typedef void (*LogicalDecodeCommitCB) (
- struct LogicalDecodingContext *,
- ReorderBufferTXN *txn
-);
+typedef void (*LogicalDecodeCommitCB) (struct LogicalDecodingContext *ctx,
+ ReorderBufferTXN *txn,
+ XLogRecPtr commit_lsn);
@@ -544,12 +537,10 @@ typedef void (*LogicalDecodeCommitCB) (
several rows at once the callback will be called individually for each
row.
-typedef void (*LogicalDecodeChangeCB) (
- struct LogicalDecodingContext *ctx,
- ReorderBufferTXN *txn,
- Relation relation,
- ReorderBufferChange *change
-);
+typedef void (*LogicalDecodeChangeCB) (struct LogicalDecodingContext *ctx,
+ ReorderBufferTXN *txn,
+ Relation relation,
+ ReorderBufferChange *change);
The ctx and txn parameters
have the same contents as for the begin_cb
--
cgit v1.2.3